有没有办法打印在给定的 Maven 运行期间运行的所有阶段、目标、配置文件和插件的图形或简单图表?似乎这有助于全面了解正在发生的事情。我知道您可以通过 -X
打开 Debug模式,但我正在寻找更简洁的东西。专门显示哪些插件在哪些阶段运行,但显示所有目标、阶段和配置文件也很有用。
最佳答案
您可以使用 buildplan-maven-plugin ,其目标是 list-phase
用于在生命周期阶段显示插件执行。
mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list-phase
您可以为特定配置文件运行此命令:只需 tack on
-P profile-name
.空 Maven 项目的示例输出:
process-resources ---------------------------------------------------
+ maven-resources-plugin | default-resources | resources
compile -------------------------------------------------------------
+ maven-compiler-plugin | default-compile | compile
process-test-resources ----------------------------------------------
+ maven-resources-plugin | default-testResources | testResources
test-compile --------------------------------------------------------
+ maven-compiler-plugin | default-testCompile | testCompile
test ----------------------------------------------------------------
+ maven-surefire-plugin | default-test | test
package -------------------------------------------------------------
+ maven-jar-plugin | default-jar | jar
install -------------------------------------------------------------
+ maven-install-plugin | default-install | install
deploy --------------------------------------------------------------
+ maven-deploy-plugin | default-deploy | deploy
关于maven - 可视化所有 Maven 阶段、目标、配置文件和插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41493359/