IntelliJ IDEA Library Generation From Ant Path

Published: 10:06 PM GMT+12, Sunday, 18 June 2006 under: technology
java  ivy  ant  dependency  intellij 

For the last few months I've been using the Ivy dependency manager on one of my ${work} projects, Ivy's been working great and I've now got 2-3 other projects publishing their dependencies via Ivy for my use.

An annoying offshoot of this is that whenever an update triggers in these other applications, I get a new binary with a new/different version number included. This likes to break IDEA and trigger lots of evil red error lines from the missing (old) library.

This morning I decided to put an end to it and whipped up a small Ant task to regenerate a project's library definitions based on an Ant path object.

Now I have in my build.xml:

<target name="update-library">
  <taskdef resource="ideatasks" classpathref="path.ivy.libs"/>
  <idealibrary projectFile="mobilemail.ipr">
    <libraryPath name="ivy-dependencies" refid="path.ivy.libs"/>
  </idealibrary>
</target>

The task is a simple, quick hack - but it does the trick nicely.

binary - source - bazaar-ng repository

Comments (2)

Access on bazaar-ng repository is denied.

left by Philipp Meier . Monday, 21 August 2006 10:29 PM

Does it update for the 3rd party library dependencies, so I could use it to update my IDEA project files' project libraries which point at my Ivy cache?

left by Jason Carreira . Monday, 19 June 2006 2:15 PM
Add Comment