2

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
codefactor
  • 1,616
  • 2
  • 18
  • 41
  • As a work around, i was able to create an NTFS junction so that my c:\Users\\.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 Jun 27 '12 at 21:53
  • I found this ticket - I think this is a bug in IvyDE https://issues.apache.org/jira/browse/IVYDE-311 – codefactor Jun 27 '12 at 22:53

3 Answers3

5

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
dieend
  • 2,231
  • 1
  • 24
  • 29
3

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?

Community
  • 1
  • 1
Mark O'Connor
  • 76,015
  • 10
  • 139
  • 185
  • I don't want to change the cache directory for one project - I want to change the default location for ivy storage. Note that in my company we have many projects that use ivy, and the settings for each project should not be machine specific. Each developer specifies the IVY_HOME directory to maximize the time based on his or her specific setup. – codefactor Jun 27 '12 at 22:48
  • @codefactor Eyad has given the other option. Set the value of the "ivy.default.ivy.user.dir" property. – Mark O'Connor Jun 28 '12 at 18:27
3

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.

Eyad Ebrahim
  • 971
  • 1
  • 8
  • 21
  • Can you specify how to setup IVY globally? Is there some environment variable that can be setup to change the location of .ivy2? At the moment, I don't see any other option other than sym links. – IceMan Nov 26 '17 at 22:26