Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Fixed
-
Affects Version/s: 2.0.6
-
Fix Version/s: 2.0.9
-
Component/s: Dependencies
-
Labels:None
-
Environment:maven 2.0.6, java version "1.5.0_07"
-
Complexity:Intermediate
-
Number of attachments :
Description
xmlbeans-maven-plugin declares a dependency on xmlbeans-2.0.0
I want to use xmlbeans-2.2.0
So in my pom I put:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>xmlbeans-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>xmlbeans</goal>
</goals>
</execution>
</executions>
<configuration>
...
</configuration>
<dependencies>
<dependency>
<groupId>xmlbeans</groupId>
<artifactId>xbean</artifactId>
<version>2.2.0</version>
</dependency>
</dependencies>
</plugin
But it still downloads 2.0.0. (as well as 2.2.0). Haven't got a clue which it is using as it doesn't seem to output stuff like that. Couldn't see a verbose or debug switch mentioned in the docs. Anyway I think it is still using 2.0.0.
Seems like I'm not the first to experience this:
http://www.nabble.com/Override-plugin-dependency-version-tf2357806s177.html#a6568092
Apparently this should be possible: http://maven.apache.org/pom.html#plugins
"dependencies: Dependencies are seen a lot within the POM, and are an element under all plugins element blocks. The dependencies have the same structure and function as under that base build. The major difference in this case is that instead of applying as dependencies of the project, they now apply as dependencies of the plugin that they are under. The power of this is to alter the dependency list of a plugin, perhaps by removing an unused runtime dependency via exclusions, or by altering the version of a required dpendency. See above under Dependencies for more information."
I also ran into this issue a couple months back. See my post on the Users list http://www.nabble.com/-Maven2--xmlbeans-maven-plugin-Issue----StAX-transitive-dependencies-t3359711s177.html
One issue that I discovered which is related to the overriding behavior in question is that if I added a few more dependencies to the POM, all of a sudden the dependency version that I specified in my plugin declaration DID successfully override the plugin version.
I could consistently get the plugin override to work after adding 5 or 6 more seemingly random jars to my dependency list.