问题
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>
来源:https://stackoverflow.com/questions/11762096/alter-ivy-xml-file-called-in-as-transitive-dependency