Ivy: how do I remove transitive dependencies?

Leonel picture Leonel · Jan 28, 2009 · Viewed 24.7k times · Source

I'm using Ivy to manage the dependencies on my project.

So far, I've specified a dependency on Hibernate and servlet-api. However, the hibernate jar itself has a lot of dependencies that aren't really needed, such as jaas and jacc.

This becomes a show-stopper because jaas and jaac are Sun libraries and therefore their licenses forbid to place them in the Maven repos, so Ivy can't find them there.

  • How do I make Ivy download Hibernate but not these two ?
  • As a bonus, if I actually needed those and downloaded their Jars from Sun, in which folder in my machine would Ivy look for them ?

Answer

Jared Oberhaus picture Jared Oberhaus · Apr 18, 2009

Another option for not downloading any dependencies is to disable them with the transitive attribute. So if you wanted hibernate-core, but none of its dependencies, you could do this:

<dependencies>  
   <dependency org="org.hibernate" name="hibernate-core"
               rev="3.3.1.GA" conf='..'
               transitive="false" /> 
</dependencies>