Question

I have spent the last few weeks in off-time trying to get Ivy going with Ant. I have it set up mostly but I've run into a road-block with depenencies.

Because I was using Ant I had a /lib folder with the 32 jar files that my app used, some in-house, some proprietary (I've added both of these types to our Nexus) and some Open Source. Then I added 32 dependency lines to my Ivy.xml file.

When I run, I get it trying to pull down LOTS of dependencies of those files from Nexus but I know I don't need ANY of these. So I tried an empty <exclude> tag in each dependency as this defaults to *, but this seems to include the dependency itself. Is there a way I can say "Exclude all dependencies of this dependency but leave it"??

The only part of Ivy I've stayed away from is the "Config" thing... I've tried to read up on it several times but... if my answer's in there, just let me know. Thanks.

Was it helpful?

Solution

Here's some previous answers on this topic:

The simplest solution is to add the transitive attribute to the dependency:

<dependency org="foo" name="bar" revision="3.0" transitive="false"/>

If you're using a Maven repository like Nexus, then a better solution is to use a configuration mapping

<dependency org="foo" name="bar" revision="3.0" conf="default->master"/>

Configurations in ivy are tough to understand, initially, but well worth the effort. I hope the following links help:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top