maven构建执行树

时间:2013-02-07 18:19:38

标签: java maven maven-3

有没有办法显示将为某些命令集执行的所有插件及其目标。

我知道maven输出了这样的信息,但它被其他输出阻塞了,提取这些信息并不是很方便。

2 个答案:

答案 0 :(得分:3)

我找到了plan-maven-plugin。也许你应该尝试一下(我肯定会,明天)。

答案 1 :(得分:2)

这里有几个命令可以提供帮助:

mvn help:describe -Dcmd=test-compile

将显示您在指定阶段调用的插件(在本例中为test-compile)。例如:

anew@Wintermute:example$ mvn help:describe -Dcmd=test-compile | grep test-compile
[INFO] 'test-compile' is a phase corresponding to this plugin:
* test-compile: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile

也很有帮助:

mvn help:effective-pom

毫无疑问会告诉你maven用来执行的有效pom。如果您有父母pom并且不确定在特定阶段究竟发生了什么,这可能是一个好方法。这是了解哪些插件的目标已绑定到<executions/>元素中的阶段的最佳方式。

mvn help:describe -Dplugin=groupId:artifactId:version

将为您提供有关插件功能的一些提示:

anew@Wintermute:example$ mvn help:describe -Dplugin=org.apache.maven.plugins:maven-deploy-plugin:2.5
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building example 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-help-plugin:2.1.1:describe (default-cli) @ pivot-api ---
[INFO] org.apache.maven.plugins:maven-deploy-plugin:2.5

Name: Maven Deploy Plugin
Description: Uploads the project artifacts to the internal remote repository.
Group Id: org.apache.maven.plugins
Artifact Id: maven-deploy-plugin
Version: 2.5
Goal Prefix: deploy

This plugin has 3 goals:

deploy:deploy
  Description: Deploys an artifact to remote repository.

deploy:deploy-file
  Description: Installs the artifact in the remote repository.

deploy:help
  Description: Display help information on maven-deploy-plugin.
    Call
      mvn deploy:help -Ddetail=true -Dgoal=<goal-name>
    to display parameter details.

For more information, run 'mvn help:describe [...] -Ddetail'