2

我有一个<filesystem>解析器ivysettings.xml,还有中央 M2 存储库,一切正常。但是,我想知道是否有一种方法可以完全绕过使用文件系统解析器找到的依赖项的缓存。我不需要在我的文件系统上多次使用它们(一次在解析器搜索的目录中,一次在缓存中,一次在每个项目的 lib 文件夹中……)。

4

1 回答 1

5

找到了。useOrigin="true"可以在解析器上指定具有属性的缓存名称:

<ivysettings>
  <settings defaultResolver="main"/>
  <caches>
    <cache name="main" basedir="${ivy.settings.dir}/ivycache" />
    <cache name="nocache" useOrigin="true" />
  </caches>
  <resolvers>
    <chain name="main">
      <filesystem name="filesystem" cache="nocache">
        <artifact pattern="${ivy.settings.dir}/ivyrep/[artifact].[ext]" />
      </filesystem>
      <ibiblio name="ibiblio" m2compatible="true" usepoms="false" />
    </chain>
  </resolvers>
</ivysettings>
于 2011-05-05T14:26:10.283 回答