The way to understand maven plugin usage

 

There are many plug-ins for maven, but there are not many articles explaining the specific usage of each plug-in in detail. If you want to know the usage of a plugin, you can find relevant articles on the Internet and go to the official website https://maven.apache.org/plugins/ . You can also find specific usages through commands.

 

The Maven help plugin is used to query information about specific plugins. The 2.2 version of the maven help plugin has 9 goals.

 

The following focuses on the usage of the describe goal.

 

     help:describe describes the properties of the plugin. It does not need to be run under the project directory. But you have to provide the prefix or groupId and artifactId you want to describe the plugin.

Through the plugin parameter you can specify which plugin you want to know about, you can pass the prefix of the plugin (for example, the prefix of the maven-war-plugin plugin is war), or it can be groupId:artifact[:version], where version is optional of

 An example is as follows (take maven-war-plugin as an example) 

mvn help:describe -Dplugin=war

or 

mvn help:describe -Dplugin=org.apache.maven.plugins:maven-war-plugin 

or

mvn help:describe -DgroupId=org.apache.maven.plugins -DartifactId=maven-war-plugin  

If you want to know more details, you can add -Ddetail or -Dfull after it, such as:

mvn help:describe -Dplugin=org.apache.maven.plugins:maven-war-plugin -Ddetail

 

 

In addition, the plugin like war itself has a goal of help, and you can also get plugin-related information through the following command:

mvn  war:help -Ddetail

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326161508&siteId=291194637