Maven 2 & 3

Ignores version of plugin dependency specified in my pom

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical 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 :
    0

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."

Issue Links

Activity

Hide
Brad Szabo added a comment -

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.

Show
Brad Szabo added a comment - 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.
Hide
Jason van Zyl added a comment -

This is not how plugin dependencies work. You actually specify the dependencies inside the plugin element. Try this and if that doesn't work then it's a bug and open a new issue.

Show
Jason van Zyl added a comment - This is not how plugin dependencies work. You actually specify the dependencies inside the plugin element. Try this and if that doesn't work then it's a bug and open a new issue.
Hide
Mark Hobson added a comment -

The POM snippet above does specify the dependencies block within the plugin element. I've encountered this problem before myself, so would have thought this should be reopened.

Show
Mark Hobson added a comment - The POM snippet above does specify the dependencies block within the plugin element. I've encountered this problem before myself, so would have thought this should be reopened.
Hide
Derek Alexander added a comment -

> You actually specify the dependencies inside the plugin element.

Yes, that's what I was doing.

OK to just reopen this issue I hope.

Show
Derek Alexander added a comment - > You actually specify the dependencies inside the plugin element. Yes, that's what I was doing. OK to just reopen this issue I hope.
Hide
Brian Fox added a comment -

I think this was fixed already. Check in 2.0.9

Show
Brian Fox added a comment - I think this was fixed already. Check in 2.0.9
Hide
Brian Fox added a comment -

This is confirmed fixed in 2.0.9, an additional IT was created to be sure.

Show
Brian Fox added a comment - This is confirmed fixed in 2.0.9, an additional IT was created to be sure.

People

Vote (5)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: