Search code examples
ivyivyde

How can I get Eclipse to use my IVY_HOME variable when downloading ivy dependencies?


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

Solution

  • 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