Home » Enterprise Java » Maven » How to display Maven plugin goals and parameters example

About Sotirios-Efstathios Maneas

Avatar photo
Sotirios-Efstathios (Stathis) Maneas is a PhD student at the Department of Computer Science at the University of Toronto. His main interests include distributed systems, storage systems, file systems, and operating systems.

How to display Maven plugin goals and parameters example

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:

mvn_help_describe_WM

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:

mvn_help_eclipse_WM

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.

Do you want to know how to develop your skillset to become a Java Rockstar?

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!

 

1. JPA Mini Book

2. JVM Troubleshooting Guide

3. JUnit Tutorial for Unit Testing

4. Java Annotations Tutorial

5. Java Interview Questions

6. Spring Interview Questions

7. Android UI Design

 

and many more ....

 

Receive Java & Developer job alerts in your Area

I have read and agree to the terms & conditions

 

Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments