Task 3: Getting Help with Maven's Help Plugin

To get information about the plugins and arifacts you want to use with Maven, you can use the help:describe goal. This goal has three main forms, triggered by setting different properties. As a reminder, you can set properties using the format -Dproperty=value on the command-line.

  • To get help with a command, set just the cmd property.
  • To get help with a specific plugin, set the plugin property. It should use the format groupId:artifactId for plugins beyond the core Maven plugins.
  • To get help with an artifact, set both the groupId and arfitactId properties.

Additional detail can be requested by setting the detail property to true.

Get information about a Command

prompt> mvn help:describe -Dcmd=install
...
[INFO] 'install' is a phase corresponding to this plugin:
org.apache.maven.plugins:maven-install-plugin:install

It is a part of the lifecycle for the POM packaging 'jar'. This lifecycle includes the following phases:
* validate: Not defined
* initialize: Not defined
...

Get information about a Plugin

prompt> mvn help:describe -Dplugin=archetype
...
Name: Maven Archetype Plugin
Description: Maven Archetype is a set of tools...
Group Id: org.apache.maven.plugins
Artifact Id: maven-archetype-plugin
Version: 2.0
Goal Prefix: archetype

This plugin has 9 goals:
...

Get detailed information about a specific Goal in a Plugin

prompt>  mvn help:describe -Dplugin=archetype -Dgoal=generate -Ddetail=true
...
archetype:generate
  Description: Generates a new project from an archetype.
  Implementation:
  org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo
  Language: java
  Before this mojo executes, it will call:
    Phase: 'generate-sources'

  Available parameters:

    archetypeArtifactId
      The archetype's artifactId.
...