In this tutorial we will show you how to display all available goals and parameters of a specific Apache Maven plugin. We will make use of Maven’s Help Plugin, which is used to get a description of a particular plugin, including the plugin’s mojos with their parameters and component requirements.
In this example, we use the following tools on a Windows 7 platform:
- Apache Maven 3.1.1
- Maven Help Plugin 2.2
- Eclipse Kepler Service Release 1
- JDK 1.7
1. Display the goals of a specific plugin
Using the terminal (Linux or Mac) or the command prompt (Windows), we execute the following command, in order to retrieve a listing with all available goals of a specific plugin. Using the
Dplugin argument, we can specify the desired plugin. For example:
mvn help:describe -Dplugin=eclipse
A sample execution of the aforementioned command is shown below:
As we can see, each plugin’s goal is described in detail. For a complete list of all available Maven Eclipse plugins, please also refer to the official page here.
2. Display the details of a plugin’s parameter
In order to retrieve a full description of a plugin’s parameter, we must execute the following command. Using the
Dplugin argument, we specify the desired plugin. The
Dmojo argument specifies the parameter and the
Dfull argument forces Maven to print the parameter’s full description. For example:
mvn help:describe -Dplugin=eclipse -Dmojo=eclipse -Dfull=true
A sample output of the above command, is shown below:
For more information and examples about
help:describe please refer to the official page here.
This was a tutorial on how to display all available plugin goals of Apache Maven, along with the parameters of each plugin.