Fork me on GitHub

Usage

List plugin executions within a project

> mvn buildplan:list

[INFO] --- buildplan-maven-plugin:2.2.2:list (default-cli) @ buildplan-maven-plugin ---
[INFO] ------------------------------------------------------------------------------------------------------------------------------
[INFO] PHASE                  | PLUGIN                      | VERSION | GOAL                      | EXECUTION ID
[INFO] ------------------------------------------------------------------------------------------------------------------------------
[INFO] generate-sources       | maven-plugin-plugin         | 3.6.4   | helpmojo                  | help-goal
[INFO] process-classes        | maven-plugin-plugin         | 3.6.4   | descriptor                | default-descriptor
[INFO] process-resources      | maven-resources-plugin      | 2.6     | resources                 | default-resources
[INFO] compile                | maven-compiler-plugin       | 3.1     | compile                   | default-compile
[INFO] process-classes        | maven-plugin-plugin         | 3.6.4   | descriptor                | mojo-descriptor
[INFO] process-test-resources | maven-resources-plugin      | 2.6     | testResources             | default-testResources
[INFO] test-compile           | maven-compiler-plugin       | 3.1     | testCompile               | default-testCompile
[INFO] test                   | maven-surefire-plugin       | 2.12.4  | test                      | default-test
[INFO] process-classes        | animal-sniffer-maven-plugin | 1.22    | check                     | check-signature
[INFO] package                | maven-jar-plugin            | 2.4     | jar                       | default-jar
[INFO] package                | maven-plugin-plugin         | 3.6.4   | addPluginArtifactMetadata | default-addPluginArtifactMetadata
[INFO] package                | maven-source-plugin         | 3.2.1   | jar-no-fork               | attach-sources
[INFO] verify                 | license-maven-plugin        | 2.0.0   | check                     | default
[INFO] install                | maven-install-plugin        | 2.4     | install                   | default-install
[INFO] deploy                 | maven-deploy-plugin         | 2.7     | deploy                    | default-deploy

It is possible to define the tasks used to calculate execution plan:

mvn buildplan:list-phase -Dbuildplan.tasks=clean,test

If you want to show the lifecycle that defines the listed phase(s), add this parameter:

mvn buildplan:list-phase -Dbuildplan.showLifecycles

List plugin executions within phases

> mvn buildplan:list-phase

[INFO] --- buildplan-maven-plugin:2.2.2:list-phase (default-cli) @ buildplan-maven-plugin ---
[INFO] install ------------------------------------------------------------------------------------------
[INFO]     + maven-install-plugin        | install                   | default-install
[INFO] generate-sources ---------------------------------------------------------------------------------
[INFO]     + maven-plugin-plugin         | helpmojo                  | help-goal
[INFO] process-resources --------------------------------------------------------------------------------
[INFO]     + maven-resources-plugin      | resources                 | default-resources
[INFO] test ---------------------------------------------------------------------------------------------
[INFO]     + maven-surefire-plugin       | test                      | default-test
[INFO] test-compile -------------------------------------------------------------------------------------
[INFO]     + maven-compiler-plugin       | testCompile               | default-testCompile
[INFO] process-test-resources ---------------------------------------------------------------------------
[INFO]     + maven-resources-plugin      | testResources             | default-testResources
[INFO] verify -------------------------------------------------------------------------------------------
[INFO]     + license-maven-plugin        | check                     | default
[INFO] process-classes ----------------------------------------------------------------------------------
[INFO]     + maven-plugin-plugin         | descriptor                | default-descriptor
[INFO]     + maven-plugin-plugin         | descriptor                | mojo-descriptor
[INFO]     + animal-sniffer-maven-plugin | check                     | check-signature
[INFO] compile ------------------------------------------------------------------------------------------
[INFO]     + maven-compiler-plugin       | compile                   | default-compile
[INFO] package ------------------------------------------------------------------------------------------
[INFO]     + maven-jar-plugin            | jar                       | default-jar
[INFO]     + maven-plugin-plugin         | addPluginArtifactMetadata | default-addPluginArtifactMetadata
[INFO]     + maven-source-plugin         | jar-no-fork               | attach-sources
[INFO] deploy -------------------------------------------------------------------------------------------
[INFO]     + maven-deploy-plugin         | deploy                    | default-deploy

It is possible to limit the list to a specific phase:

mvn buildplan:list-phase -Dbuildplan.phase=test

If you want to include phases that have no executions mapped:

mvn buildplan:list-phase -Dbuildplan.showAllPhases

Here it is also possible to show the lifecycle(s) by running:

mvn buildplan:list-phase -Dbuildplan.showLifecycles

Be aware that setting buildplan.tasks to direct plugin-executions (eg ‘release:prepare’) will show an empty lifecycle and ‘<no phase>’, since they are not mapped. Also, because executions are collected per phase, direct plugin-executions are shown in the list at the location of the very first execution.

List plugin executions by plugins

> mvn buildplan:list-plugin

[INFO] --- buildplan-maven-plugin:2.2.2:list-plugin (default-cli) @ buildplan-maven-plugin ---
[INFO] maven-deploy-plugin -------------------------------------------------------------------------
[INFO]     + deploy                 | deploy                    | default-deploy
[INFO] maven-source-plugin -------------------------------------------------------------------------
[INFO]     + package                | jar-no-fork               | attach-sources
[INFO] license-maven-plugin ------------------------------------------------------------------------
[INFO]     + verify                 | check                     | default
[INFO] maven-resources-plugin ----------------------------------------------------------------------
[INFO]     + process-resources      | resources                 | default-resources
[INFO]     + process-test-resources | testResources             | default-testResources
[INFO] maven-plugin-plugin -------------------------------------------------------------------------
[INFO]     + generate-sources       | helpmojo                  | help-goal
[INFO]     + process-classes        | descriptor                | default-descriptor
[INFO]     + process-classes        | descriptor                | mojo-descriptor
[INFO]     + package                | addPluginArtifactMetadata | default-addPluginArtifactMetadata
[INFO] maven-jar-plugin ----------------------------------------------------------------------------
[INFO]     + package                | jar                       | default-jar
[INFO] animal-sniffer-maven-plugin -----------------------------------------------------------------
[INFO]     + process-classes        | check                     | check-signature
[INFO] maven-surefire-plugin -----------------------------------------------------------------------
[INFO]     + test                   | test                      | default-test
[INFO] maven-compiler-plugin -----------------------------------------------------------------------
[INFO]     + compile                | compile                   | default-compile
[INFO]     + test-compile           | testCompile               | default-testCompile
[INFO] maven-install-plugin ------------------------------------------------------------------------
[INFO]     + install                | install                   | default-install

It is possible to limit the list to a specific plugin:

mvn buildplan:list-plugin -Dbuildplan.plugin=maven-compiler-plugin

It is possible to redirect the output to a file:

mvn buildplan:list-plugin -Dbuildplan.outputFile=buildplan_output.txt

Generate the report as part of project reports

To generate the report as part of the site generation, add the following in the <reporting> section of your POM:

    <project>
      ...
      <reporting>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>buildplan-maven-plugin</artifactId>
            <version>2.2.2</version>
          </plugin>
        </plugins>
      </reporting>
      ...
    </project>

When mvn site is invoked, the report will automatically be included in the Project Reports menu as shown in the figure below.

buildplan report example

Generate the report in a standalone fashion

mvn buildplan:report

A HTML report should be generated in ${basedir}/target/site/buildplan-report.html.