5
votes

Is there a way print a graph or simple chart of all the phases, goals, profiles, and plugins running during a given run of Maven? It seems like this would be useful to see a big picture of what is going on. I know you can turn on debug mode via -X, but I'm looking for something more concise. Specifically to show which plugins are running in which phases, but showing all goals, phases, and profiles would be useful as well.

1
Like this: mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list-phase? - approxiblue
Yes!! Exactly what I was looking for! Thanks! Add it as an answer and I'll accept it. - xdhmoore

1 Answers

6
votes

You can use buildplan-maven-plugin, which has the goal list-phase for displaying plugin executions within lifecycle phases.

mvn fr.jcgay.maven.plugins:buildplan-maven-plugin:list-phase

You can run this for a specific profile: just tack on -P profile-name.

Example output on an empty Maven project:

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