Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Won't Fix
-
Affects Version/s: 2.0.4
-
Fix Version/s: None
-
Component/s: Artifacts and Repositories
-
Labels:None
-
Complexity:Intermediate
-
Testcase included:yes
Description
I need to be able to exclude a dependency that a plugin included so I can replace it with a different dependency. In this exact case I'm attempting to use the com.sun.tools.xjc.maven2:maven-jaxb-plugin:1.0 plugin and it depends on the non-public jsr173 jar. I would like to exclude that jar so I can include public stax one. I know this will be fixed by implementing the spec resolution feature, but excluding bad dependencies from a plugin is a general problem.
The following snippit will demonstrate the download problem assuming you don't have the jsr173 jar available:
<plugin>
<groupId>com.sun.tools.xjc.maven2</groupId>
<artifactId>maven-jaxb-plugin</artifactId>
<version>1.0</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<generatePackage>org.apache.xbean.jaxb.schema</generatePackage>
</configuration>
</configuration>
</plugin>
Issue Links
- duplicates
-
MNG-2163
Allow plugin dependencies to be excluded
-
Just redeclare the dependency as you normally do inside <plugin><dependencies>.
Since maven 2.0.5, (or possibly 2.0.6) that declaration will override the one from the plugin itself.