有没有办法打印在给定的 Maven 运行期间运行的所有阶段、目标、配置文件和插件的图形或简单图表?似乎这有助于全面了解正在发生的事情。我知道您可以通过 开启调试模式-X,但我正在寻找更简洁的东西。专门显示哪些插件在哪些阶段运行,但显示所有目标、阶段和配置文件也很有用。
您可以使用buildplan-maven-plugin,它的目标list-phase是在生命周期阶段显示插件执行。
mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list-phase
Run Code Online (Sandbox Code Playgroud)
您可以为特定的配置文件运行以下命令:只是钉在-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
Run Code Online (Sandbox Code Playgroud)