Alter ivy.xml file called in as transitive depende

2019-09-27 00:22发布

问题:

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?

回答1:

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"/>
</dependency>

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" />
</dependency>


标签: ivy