Alter ivy.xml file called in as transitive dependency

Tag: ivy Author: hebc20000 Date: 2012-07-16

I am using ivy to resolve dependencies, the direct dependency I have is for jdom with the entry on ivy.xml as

     <dependency org="org.jdom" name="jdom" rev="2.0.2"/>

This calls in several other jars as transitive dependencies - unfortunately one, jaxen, has a non working dependency as per Jaxen bug and various questions on SO here and here. Unfortunately these questions are answered with a fix to a maven pom.

My question is what can I do in my ivy setup to use a corrected ivy file for jaxen or just suppress jaxen trying to load findbugs and cobertura?

As this has several down votes I would ask why as this is not directly in the documentation and seems to me to have all the details needed?

Best Answer

Ivy allows to exclude specified dependencies from resolution.

This will exclude jaxen from the dependency:

<dependency org="org.jdom" name="jdom" rev="2.0.2">
  <exclude module="jaxen"/>

This will exclude cobertura and findbugs

<dependency org="org.jdom" name="jdom" rev="2.0.2">
  <exclude name="maven-cobertura-plugin" />
  <exclude name="maven-findbugs-plugin" />