Maven plugin to analyse the execution plan

Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/

License

License

Categories

Categories

Maven Build Tools
GroupId

GroupId

tk.skuro
ArtifactId

ArtifactId

plan-maven-plugin
Last Version

Last Version

1.2
Release Date

Release Date

Type

Type

maven-plugin
Description

Description

Maven plugin to analyse the execution plan
Sonatype helps open source projects to set up Maven repositories on https://oss.sonatype.org/
Source Code Management

Source Code Management

https://github.com/skuro/plan-maven-plugin

Download plan-maven-plugin

How to add to project

<plugin>
    <groupId>tk.skuro</groupId>
    <artifactId>plan-maven-plugin</artifactId>
    <version>1.2</version>
</plugin>

Dependencies

compile (4)

Group / Artifact Type Version
org.apache.maven : maven-plugin-api jar 3.2.5
org.apache.maven : maven-core jar 3.2.5
org.sonatype.sisu : sisu-inject-plexus jar 2.1.1
com.samskivert : jmustache jar 1.5

Project Modules

There are no modules declared in this project.

Plan Maven Plugin

Latest version Build Status

Add it to your project POM:

<plugins>
  <plugin>
    <groupId>tk.skuro</groupId>
    <artifactId>plan-maven-plugin</artifactId>
    <version>1.2</version> <!-- use 1.1 if using maven < 3.1.0 -->
  </plugin>
</plugins>

Or enable it globally in your settings.xml:

<settings>
  <pluginGroups>
    <pluginGroup>tk.skuro</pluginGroup>
  </pluginGroups>
</settings>

Execution plans explained

When creating complex builds with Maven, which extensively use profiles and activation rules, making sure that plugins execute in the proper order is sometimes a challenge in itself. This plugin queries the Maven machinery to provide a clean and concise report of your build execution plan, including the full list of the steps of the current lifecycle and the plugin executions linked to any lifecycle step.

The reported executions are given in the format:

[{lifecyle-phase}] {groupId}:{artifactId}:{goal} ({execution-id})

Where [-] indicates that a plugin goal is directly executed instead of being triggered by a lifecycle step.

Usage

You can specify a set of goals without actually executing them:

$ mvn plan:plan -Dgoals=jar:jar
[INFO] --- plan-maven-plugin:1.1:plan (default-cli) @ plan-maven-plugin ---
[INFO]
[INFO] Execution plan:
[INFO]     [-] org.apache.maven.plugins:maven-jar-plugin:jar (default-cli)
[INFO]

You can also run it as part of the normal build, letting it log the plan along with executing the build itself:

$ mvn plan:plan clean javadoc:javadoc package install site:site
[...]
[INFO] --- plan-maven-plugin:1.1:plan (default-cli) @ plan-maven-plugin ---
[INFO]
[INFO] Current lifecycle:
[INFO]     pre-clean
[INFO]     clean
[INFO]     post-clean
[INFO]     validate
[INFO]     initialize
[INFO]     generate-sources
[INFO]     process-sources
[INFO]     generate-resources
[INFO]     process-resources
[INFO]     compile
[INFO]     process-classes
[INFO]     generate-test-sources
[INFO]     process-test-sources
[INFO]     generate-test-resources
[INFO]     process-test-resources
[INFO]     test-compile
[INFO]     process-test-classes
[INFO]     test
[INFO]     prepare-package
[INFO]     package
[INFO]     pre-integration-test
[INFO]     integration-test
[INFO]     post-integration-test
[INFO]     verify
[INFO]     install
[INFO]     deploy
[INFO]
[INFO] Execution plan:
[INFO]     [-] tk.skuro:plan-maven-plugin:plan (default-cli)
[INFO]     [clean] org.apache.maven.plugins:maven-clean-plugin:clean (default-clean)
[INFO]     [-] org.apache.maven.plugins:maven-javadoc-plugin:javadoc (default-cli)
[INFO]     [validate] org.apache.maven.plugins:maven-enforcer-plugin:enforce (enforce-maven)
[INFO]     [generate-resources] org.apache.maven.plugins:maven-plugin-plugin:descriptor (default-descriptor)
[INFO]     [process-resources] org.apache.maven.plugins:maven-resources-plugin:resources (default-resources)
[INFO]     [compile] org.apache.maven.plugins:maven-compiler-plugin:compile (default-compile)
[INFO]     [process-test-resources] org.apache.maven.plugins:maven-resources-plugin:testResources (default-testResources)
[INFO]     [test-compile] org.apache.maven.plugins:maven-compiler-plugin:testCompile (default-testCompile)
[INFO]     [test] org.apache.maven.plugins:maven-surefire-plugin:test (default-test)
[INFO]     [package] org.apache.maven.plugins:maven-jar-plugin:jar (default-jar)
[INFO]     [package] org.apache.maven.plugins:maven-plugin-plugin:addPluginArtifactMetadata (default-addPluginArtifactMetadata)
[INFO]     [validate] org.apache.maven.plugins:maven-enforcer-plugin:enforce (enforce-maven)
[INFO]     [generate-resources] org.apache.maven.plugins:maven-plugin-plugin:descriptor (default-descriptor)
[INFO]     [process-resources] org.apache.maven.plugins:maven-resources-plugin:resources (default-resources)
[INFO]     [compile] org.apache.maven.plugins:maven-compiler-plugin:compile (default-compile)
[INFO]     [process-test-resources] org.apache.maven.plugins:maven-resources-plugin:testResources (default-testResources)
[INFO]     [test-compile] org.apache.maven.plugins:maven-compiler-plugin:testCompile (default-testCompile)
[INFO]     [test] org.apache.maven.plugins:maven-surefire-plugin:test (default-test)
[INFO]     [package] org.apache.maven.plugins:maven-jar-plugin:jar (default-jar)
[INFO]     [package] org.apache.maven.plugins:maven-plugin-plugin:addPluginArtifactMetadata (default-addPluginArtifactMetadata)
[INFO]     [install] org.apache.maven.plugins:maven-install-plugin:install (default-install)
[INFO]     [-] org.apache.maven.plugins:maven-site-plugin:site (default-cli)
[INFO]

Versions

Version
1.2
1.1
1.0