Set plugin’s version on the command line in maven 2

Posted by larry cai on Stack Overflow See other posts from Stack Overflow or by larry cai
Published on 2010-05-20T04:42:32Z Indexed on 2010/05/20 4:50 UTC
Read the original article Hit count: 186

Filed under:
|

I generate default quickstart maven example, and type mvn checkstyle:checkstyle, it always try to use the lastest SNAPSHOT version, probably it is wrong in my nexus server, but

How can I set plugin's version on the command line in maven2, like 2.5 for checkstyle instead of 2.6-SNAPSHOT

C:\HelloWorld>mvn checkstyle:checkstyle
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'checkstyle'.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).

Project ID: org.apache.maven.plugins:maven-checkstyle-plugin

Reason: Error getting POM for 'org.apache.maven.plugins:maven-checkstyle-plugin' from  the repository: Failed to resolve artifact, possibly due to a repository list that is not appropriately equipped for this artifact's metadata.
  org.apache.maven.plugins:maven-checkstyle-plugin:pom:2.6-SNAPSHOT

from the specified remote repositories:
  nexus (http://localhost:9081/nexus/content/groups/public)

for project org.apache.maven.plugins:maven-checkstyle-plugin

I guess it could be "mvn checkstyle:2.5:checkstyle", unfortunately it is not.

Surely if I set build dependance in pom.xml, it will work, but I want to see how command line can works

© Stack Overflow or respective owner

Related posts about maven-2

Related posts about Snapshot