How can I find out the default phase a Maven goal binds to?

落花浮王杯 提交于 2019-12-03 02:39:47

The simplest solution is to use the maven-help-plugin like the following:

mvn help:describe -DartifactId=maven-compiler-plugin -DgroupId=org.apache.maven.plugins -Dgoal=compile -Ddetail

which will printout many information but in the first lines:

[INFO] Mojo: 'compiler:compile'
compiler:compile
  Description: Compiles application sources
  Implementation: org.apache.maven.plugin.CompilerMojo
  Language: java
  Bound to phase: compile

  Available parameters:
  ....

If you try that for jetty:run like this:

mvn help:describe -DartifactId=jetty-maven-plugin -DgroupId=org.mortbay.jetty -Dgoal=run -Ddetail

You will get a large output but you won't see a default phase, cause it's intended to be called from command line:

[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:
      ....
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!