最简单的解决方案是使用maven-help-plugin,如下所示:
mvn help:describe -DartifactId=maven-compiler-plugin -DgroupId=org.apache.maven.plugins -Dgoal=compile -Ddetail
这将打印出许多信息,但在第一行:
[INFO] Mojo: 'compiler:compile'
compiler:compile
Description: Compiles application sources
Implementation: org.apache.maven.plugin.CompilerMojo
Language: java
Bound to phase: compile
Available parameters:
....
如果您尝试使用 jetty:run 像这样:
mvn help:describe -DartifactId=jetty-maven-plugin -DgroupId=org.mortbay.jetty -Dgoal=run -Ddetail
您将获得大量输出,但您不会看到默认阶段,因为它打算从命令行调用:
[INFO] Mojo: 'jetty:run'
jetty:run
Description: This goal is used in-situ on a Maven project without first
....
redeploying.
.....
Implementation: org.mortbay.jetty.plugin.JettyRunMojo
Language: java
Before this mojo executes, it will call:
Phase: 'test-compile'
Available parameters:
....