How can I use a <filesystem> resolver that doesn't copy artifacts to the cache in Ivy?

StackOverflow https://stackoverflow.com/questions/5899235

  •  29-10-2019
  •  | 
  •  

문제

I have a <filesystem> resolver in my ivysettings.xml, along with the central M2 repository, and it all works OK. However, I was wondering whether there is a way to bypass the cache entirely for the dependencies found with the filesystem resolver. I don't need to have them so many times around on my filesystem (once in the directory searched by the resolver, once in the cache, and once in each project's lib folder…).

도움이 되었습니까?

해결책

Found it. The name of a cache with the useOrigin="true" attribute can be specified on the resolver:

<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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top