maven 插件help帮助命令
一旦你开始使用 Maven,你会花很多时间去试图获得 Maven 插件的信息:插件如何
工作?配置参数是什么?目标是什么? 你会经常使用 help:describe 目标来获取这
些信息。通过 plugin 参数你可以指定你想要研究哪个插件,你可以传入插件的前缀
(如 help 插件就是 maven-help-plugin ),或者可以是
groupId:artifact[:version] ,这里 version 是可选的。比如, 下面的命令使用
help 插件的 describe 目标来输出 Maven Help 插件的信息。
$ mvn help:describe -Dplugin=help
...
Group Id: org.apache.maven.plugins
Artifact Id: maven-help-plugin
Version: 2.0.1
Goal Prefix: help
Description:
The Maven Help plugin provides goals aimed at helping to make sense out of
the build environment. It includes the ability to view the effective
POM and settings files, after inheritance and active profiles
have been applied, as well as a describe a particular plugin goal to give
usage information.
...
通过设置 plugin 参数来运行 describe 目标,输出为该插件的 Maven 坐标,目标
前缀,和该插件的一个简要介绍。尽管这些信息非常有帮助,你通常还是需要了解更多
的详情。如果你想要 Help 插件输出完整的带有参数的目标列表,只要运行带有参数
full 的 help:describe 目标就可以了,像这样:
$ mvn help:describe -Dplugin=help -Dfull
...
Group Id: org.apache.maven.plugins
Artifact Id: maven-help-plugin
Version: 2.0.1
Goal Prefix: help
Description:
The Maven Help plugin provides goals aimed at helping to make sense out of
the build environment. It includes the ability to view the effective
POM and settings files, after inheritance and active profiles
have been applied, as well as a describe a particular plugin goal to give
usage
information.
Mojos:
===============================================
Goal: 'active-profiles'
===============================================
Description:
Lists the profiles which are currently active for this build.
Implementation: org.apache.maven.plugins.help.ActiveProfilesMojo
Language: java
Parameters:
-----------------------------------------------
[0] Name: output
Type: java.io.File
Required: false
Directly editable: true
Description:
This is an optional parameter for a file destination for the output of this
mojo...the
listing of active profiles per project.
-----------------------------------------------
[1] Name: projects
Type: java.util.List
Required: true
Directly editable: false
Description:
This is the list of projects currently slated to be built by Maven.
-----------------------------------------------
This mojo doesn't have any component requirements.
===============================================
... removed the other goals ...
该选项能让你查看插件所有的目标及相关参数。但是有时候这些信息显得太多了。这时
候你可以获取单个目标的信息,设置 mojo 参数和 plugin 参数。下面的命令列出了
Compiler 插件的 compile 目标的所有信息

浙公网安备 33010602011771号