[ACCEPTED]-How to override the location of Ivy's Cache?-ivy

Accepted answer
Score: 19

Something like this in ivysettings.xml:

<ivysettings>
    <caches defaultCacheDir="/path/to/my/cache/dir"/>
</ivysettings>

See documentation 1 at http://ant.apache.org/ivy/history/latest-milestone/settings/caches.html

Score: 13

I'm use Jenkins as CI build system, and 3 create $HOME/.ivy2/ivysettings.xml:

<ivysettings>
    <properties environment="env" />
    <caches defaultCacheDir="${env.WORKSPACE}/.ivy2/cache" />
</ivysettings>

This 2 create the ivy cache dir at each jenkins 1 job's workspace.

Score: 4

Although the answer above from skaffman 14 is correct, I found it to be a lot more 13 work than I had expected!

When I added the 12 ivysettings.xml file to the project, I then 11 needed to redefine almost everything, as 10 the default values had been working fine 9 until then.

so, I found out how to add 8 the new cache directory to the in-line command-line 7 within my NAnt script...

< exec program="java" commandline="... ... -jar ${ivy.jar} -cache ${project.cache} ... ... />

(Where ${ivy.jar} is the location 6 of my .jar file and ${project.cache} is the new location 5 set earlier in the script where I want the 4 cache area to use.)

This means that I don't 3 need the ivysettings.xml file, and I can 2 revert everything back to using the default 1 resolvers, etc.

More Related questions