2
votes

My company uses extensive use of ivy to download dependencies. Some of these dependencies are huge (~500MB) and take a while to download from the remote repositories.

To build our application we have an ant script that will first resolve all the dependencies and the deploy to the server.

I have set an "IVY_HOME" environment variable so that all the dependencies are downloaded to D:\ivy_home instead of C:\Users\.ivy2\ - this is because D: is my SSD which is significantly faster, and it is where my local server directories are located - so copying files from ivy_home to the server is super fast.

But for some reason when I am using IvyDE plugin inside eclipse - it always wants to download a separate copy of all the dependencies and puts them into my C:\ which is causing several issues:

  1. Local publishes from the ant script will not be picked up in eclipse since they are placed into a different location
  2. Dependencies already downloaded in D: will not get picked up which makes the ivy Resolve inside eclipse much slower than it needs to be
  3. The dependencies are in a slower drive in eclipse so performing searches, and executing these jars is also slower
3
As a work around, i was able to create an NTFS junction so that my c:\Users\<username>\.ivy2 directory in reality points to same directory as my IVY_HOME. But apparently the NTFS junction has some overhead associated with it and is not a perfect solution. - codefactor
I found this ticket - I think this is a bug in IvyDE issues.apache.org/jira/browse/IVYDE-311 - codefactor

3 Answers

5
votes

How about creating symlink to replace the .ivy2 in Users to D? I've tried it on my own and it's looks working fine.

Open cmd as root, and then execute this line

mklink /d C:\Users\{username}\.ivy2 D:\.ivy2
3
votes

I'd create an ivysettings.xml file and specify the location of my cache using the caches directive. See the following answer for example:

can I turn off the .ivy cache all together?

3
votes

Why don't you set up IVY globally with the ivysettings.xml along with a property file. This property file could have this:

ivy.default.ivy.user.dir=D:\ivy_home

For individual projects you could uncheck "enable project specific settings" for each IvyDE library management, so they would use IVY global settings, with one extra eclipse environment configuration.