views:

143

answers:

2

I am new in Maven. Do you know what I am doing wrong (see below)?


mvn -e clean:help.  
+ Error stacktraces are turned on.  
[INFO] Scanning for projects...  
[INFO] Searching repository for plugin with prefix: 'clean'.  
[INFO] ------------------------------------------------------------------------ 
[ERROR] BUILD FAILURE  
[INFO] ------------------------------------------------------------------------  
[INFO] Required goal not found: clean:help in org.apache.maven.plugins:maven-clean-plugin:2.2  
[INFO] ------------------------------------------------------------------------  
[INFO] Trace  
org.apache.maven.BuildFailureException: Required goal not found: clean:help in org.apache.maven.plugins:maven-clean-plugin:2.2
    at   org.apache.maven.lifecycle.DefaultLifecycleExecutor.getMojoDescriptor(DefaultLifecycleExecutor.java:1867)
    at   org.apache.maven.lifecycle.DefaultLifecycleExecutor.segmentTaskListByAggregationNeeds(DefaultLifecycleExecutor.java:462)
    at   org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:175)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
+3  A: 

I think you want:

mvn help:describe -Dcmd=clean

which gives:

[INFO] [help:describe {execution: default-cli}]
[INFO] 'clean' is a lifecycle with the following phases: 
* pre-clean: Not defined
* clean: org.apache.maven.plugins:maven-clean-plugin:clean
* post-clean: Not defined

See here for more details and examples. The same applies for compile.

mvn help:describe -Dcmd=compile
Brian Agnew
Thanks. It is not exactly what I was looking for, but the info is interesting.
SirFabel
+3  A: 

The version of the plugin you are using on the command line (2.2) does not have the clean:help goal (since 2.3). Try this instead:

mvn org.apache.maven.plugins:maven-clean-plugin:2.4:help
Pascal Thivent
Thanks but do you know why maven does not download this version automatically? I thought the default rule was to get last versions of plugins...
SirFabel
@SirFabel No, versions of core plugins are fixed in the super pom (see http://www.sonatype.com/books/mvnref-book/reference/pom-relationships-sect-pom.html#ex-super-pom) for build reproducibility (http://jira.codehaus.org/browse/MNG-3395).
Pascal Thivent