Wednesday, April 1, 2009

Getting Maven plugin information

Recently I have discovered (what a shame I haven't done it much earlier! :) ) that to get information on Maven plugin goals and parameters it is possible to use help plugin (and not dive into plugin descriptor files packaged into JARs):
mvn help:describe -Dplugin=surefire -Dmojo=compile -Ddetail

Here is a plugin self-explanation that does not need extra comments:
$ mvn help:describe -Dplugin=help -Dmojo=describe -Ddetail
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'help'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [help:describe] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [help:describe]
[INFO] Mojo: 'help:describe'
help:describe
Description: Displays a list of the attributes for a Maven Plugin and/or
goals (aka Mojo - Maven plain Old Java Object).
Deprecated. No reason given
Implementation: org.apache.maven.plugins.help.DescribeMojo
Language: java

Available parameters:

artifactId
The Maven Plugin artifactId to describe.
Note: Should be used with groupId parameter.
Deprecated. No reason given

cmd
A Maven command like a single goal or a single phase following the Maven
command line:
mvn [options] [] []
Deprecated. No reason given

detail (Default: false)
This flag specifies that a detailed (verbose) list of goal (Mojo)
information should be given.
Deprecated. No reason given

goal
The goal name of a Mojo to describe within the specified Maven Plugin. If
this parameter is specified, only the corresponding goal (Mojo) will be
described, rather than the whole Plugin.
Deprecated. No reason given

groupId
The Maven Plugin groupId to describe.
Note: Should be used with artifactId parameter.
Deprecated. No reason given

medium (Default: true)
This flag specifies that a medium list of goal (Mojo) information should
be given.
Deprecated. No reason given

minimal (Default: false)
This flag specifies that a minimal list of goal (Mojo) information should
be given.
Deprecated. No reason given

output
Optional parameter to write the output of this help in a given file,
instead of writing to the console.
Note: Could be a relative path.
Deprecated. No reason given

plugin
The Maven Plugin to describe. This must be specified in one of three
ways:

1. plugin-prefix, i.e. 'help'
2. groupId:artifactId, i.e. 'org.apache.maven.plugins:maven-help-plugin'
3. groupId:artifactId:version, i.e.
'org.apache.maven.plugins:maven-help-plugin:2.0'
Deprecated. No reason given

version
The Maven Plugin version to describe.
Note: Should be used with groupId/artifactId parameters.
Deprecated. No reason given

No comments:

Post a Comment