10

What if I have (for example) 2 versions of the same maven plugin - versions-maven-plugin for example. There is 1.0 and 2.0 versions already in my repository. When I execute the following command it looks like the 1.0 version is executed:

mvn -e versions:display-plugin-updates

How can I explicitly specify to use 2.0 version?

Vic
  • 21,473
  • 11
  • 76
  • 97

1 Answers1

25

The simple solution is to define the groupId/artifactId and of course the version like the following:

mvn -e org.codehaus.mojo:versions-maven-plugin:2.0:display-plugin-updates
khmarbaise
  • 92,914
  • 28
  • 189
  • 235
  • I've found that this doesn't work for all goals, though I don't quite understand why... `mvn clean org.apache.maven.plugins:maven-install-plugin:2.5.1:install` doesn't work, but `mvn clean org.apache.maven.plugins:maven-install-plugin:2.5.1:install-file` does work. – Jeff Fairley Jul 22 '14 at 17:20
  • The install goal is not intended to be called from command line without life cylce whereas the install-file is intended to be called from command line without life cycle. – khmarbaise Jul 22 '14 at 22:02
  • 2
    That's unfortunate. With that command, I intend for the same thing to happen as if has executed `mvn clean install`, only I want to force a particular version of the install plugin. In my case, I'm creating a generic build script for my CI server, and I want to enforce `2.5.1` via command-line arg rather than update the `pom.xml` for every project. – Jeff Fairley Jul 22 '14 at 22:26