如何在Ivy中使用不会将工件复制到缓存的<filesystem>解析程序?

Jea*_*let 2 caching ivy resolver

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

Jea*_*let 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>
Run Code Online (Sandbox Code Playgroud)