How do I list the goals of a maven plugin?
Author: Deron Eriksson
Description: This tutorial describes how to list the goals of a maven plugin.
Tutorial created using: Windows Vista || JDK 1.6.0_04 || Eclipse Web Tools Platform 2.0.1 (Eclipse 3.3.1)


Page: < 1 2

(Continued from page 1)

Just for fun, I'll try getting the medium description of another plugin. This time, I'll try the "help" plugin itself.

Inputting 'help' as plugin value

We can see that the mavenSW help plugin has four goals: active-profiles, describe, effective-pom, and effective-settings.

Console output from 'mvn help:describe -Dplugin=help -Dmedium=true'

[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] Plugin: 'org.apache.maven.plugins:maven-help-plugin:2.0.2'
-----------------------------------------------
Group Id:  org.apache.maven.plugins
Artifact Id: maven-help-plugin
Version:     2.0.2
Goal Prefix: help
Description:

The Maven Help plugin provides goals aimed at helping to make sense out of
    the build environment. It includes the ability to view the effective
    POM and settings files, after inheritance and active profiles
    have been applied, as well as a describe a particular plugin goal to give usage information.

Mojos:

Goal: 'active-profiles'
Description:
Lists the profiles which are currently active for this build.

Goal: 'describe'
Description:
Describes the attributes of a plugin and/or plugin mojo.

Goal: 'effective-pom'
Description:
Display the effective POM for this build, with the active profiles factored in.

Goal: 'effective-settings'
Description:
Print out the calculated settings for this project, given any profile enhancement and
the inheritance of the global settings into the user-level settings.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sat Feb 09 18:28:18 PST 2008
[INFO] Final Memory: 2M/5M
[INFO] ------------------------------------------------------------------------

The medium description is a great way to get a summary of the goals offered by a plugin. For detailed information about each goal, such as the parameters that the goal takes, we can do a "full" listing instead of a "medium" listing. This is covered in another tutorial.

Page: < 1 2