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 >

The mavenSW help plugin has a "describe" goal that can be used to display information about a particular maven plugin. One piece of information that is very useful to know is the goals a particular plugin has available in it. The "describe" goal can take an optional "medium" parameter that can be used to display a medium-level description of a plugin. This description includes a listing of the goals offered by the plugin.

To simplify calling the help:describe goal from EclipseSW, I created an external tool configuration. This configuration includes a pop-up prompt (string_prompt) that asks for the plugin to describe.

Name:mvn help~describe medium
Location:C:\dev\apache-maven-2.0.8\bin\mvn.bat
Working Directory:${workspace_loc}
Arguments:help:describe -Dmedium=true -Dplugin=${string_prompt:plugin}

The external tool configuration window is shown here.

External Tool Configuration

To call the external tool, I'll select it from the list of external tools.

Executing External Tool Configuration

When prompted for the plugin to describe, I entered "war", for the maven warW plugin that builds war files. NOTE: If the plugin isn't already present in your local repository, you may need to fully qualify your maven coordinates for the plugin (ie, instead of "war", you might need to enter something like "org.apache.maven.plugins:maven-war-plugin:2.1-alpha-1").

Inputting plugin value

The console output is shown here. We can see that the war plugin has four goals: exploded, inplace, manifest, and war.

Console output from 'mvn help:describe -Dplugin=war -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-war-plugin:2.1-alpha-1'
-----------------------------------------------
Group Id:  org.apache.maven.plugins
Artifact Id: maven-war-plugin
Version:     2.1-alpha-1
Goal Prefix: war
Description:

Maven Plugins

Mojos:

Goal: 'exploded'
Description:
Generate the exploded webapp

Goal: 'inplace'
Description:
Generates webapp in the source directory

Goal: 'manifest'
Description:
Generate a manifest for this WAR.

Goal: 'war'
Description:
Build a war/webapp.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Sat Feb 09 18:27:14 PST 2008
[INFO] Final Memory: 3M/7M
[INFO] ------------------------------------------------------------------------

(Continued on page 2)

Page:    1 2 >