博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何查看maven plugin所包含的goal
阅读量:5334 次
发布时间:2019-06-15

本文共 5015 字,大约阅读时间需要 16 分钟。

本文主要说明如何使用maven的help插件查看其他maven插件提供的goal信息。

maven项目的构建生命周期(build lifecycle)由很多阶段组成:从validate到deploy。

maven插件中包含goal。这些goal可以被绑定到不同的maven的构建阶段上。goal表示一个特定的任务,是一个比构建阶段更细粒度的构建步骤,用于构建和管理当前项目。

要使用maven插件提供的goal,首先得知道这些插件提供了哪些goal以及他们的用法。

maven的核心插件之一 --- help插件(Maven Help Plugin)可以用于查看插件提供了哪些goal。

以下是maven help插件的概述信息:

The Maven Help Plugin is used to get relative information about a project or the system. It can be used to get a description of a particular plugin, including the plugin's mojos with their parameters and component requirements, the effective POM and effective settings of the current build, and the profiles applied to the current project being built.

关于maven help插件的详细信息请参考页面。此处,仅举例说明如何使用help插件查看plugin goal的信息。

以maven-eclipse-plugin为例,举例说明。

1,首先在pom.xml文件中配置插件。

org.apache.maven.plugins
maven-eclipse-plugin
2.10
true
true
2.0
spring3

2,从命令行进入项目所在路径(pom.xml所在的路径)。

3,按如下格式执行命令:

mvn help:describe -Dplugin=groupId:artifactId:version

如:

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

然后回车,则输出如下信息:

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building development 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-help-plugin:2.2:describe (default-cli) @ development ---
[INFO] org.apache.maven.plugins:maven-eclipse-plugin:2.10
Name: Apache Maven Eclipse Plugin
Description: The Eclipse Plugin is used to generate Eclipse IDE files
  (.project, .classpath and the .settings folder) from a POM.
Group Id: org.apache.maven.plugins
Artifact Id: maven-eclipse-plugin
Version: 2.10
Goal Prefix: eclipse
This plugin has 12 goals:
eclipse:clean
  Description: Deletes the .project, .classpath, .wtpmodules files and
    .settings folder used by Eclipse.
eclipse:configure-workspace
  Description: Configures The following Eclipse Workspace features:
    - Adds the classpath variable MAVEN_REPO to Eclipse.
    - Optionally load Eclipse code style file via a URL.
eclipse:eclipse
  Description: Generates the following eclipse configuration files:
    - .project and .classpath files
    - .setting/org.eclipse.jdt.core.prefs with project specific compiler
      settings
    - various configuration files for WTP (Web Tools Project), if the parameter
      wtpversion is set to a valid version (WTP configuration is not generated
      by default)
    If this goal is run on a multiproject root, dependencies between modules
    will be configured as direct project dependencies in Eclipse (unless
    useProjectReferences is set to false).
eclipse:help
  Description: Display help information on maven-eclipse-plugin.
    Call mvn eclipse:help -Ddetail=true -Dgoal=<goal-name> to display parameter
    details.
eclipse:install-plugins
  Description: Install plugins resolved from the Maven repository system into
    an Eclipse instance.
eclipse:myeclipse
  Description: Generates MyEclipse configuration files
eclipse:myeclipse-clean
  Description: Deletes configuration files used by MyEclipse
eclipse:rad
  Description: Generates the rad-6 configuration files.
eclipse:rad-clean
  Description: Deletes the config files used by Rad-6. the files .j2ee and
    the file .websettings
eclipse:remove-cache
  Description: Removes the not-available marker files from the repository.
eclipse:resolve-workspace-dependencies
  Description: For all projects currently part of the workspace, all
    references to the M2_REPO classpath variable are resolved.
    Note: not the projects of the reactor are inspected for unresolved
    artifacts, but the projects that are part of the workspace.
eclipse:to-maven
  Description: Add eclipse artifacts from an eclipse installation to the
    local repo. This mojo automatically analize the eclipse directory, copy
    plugins jars to the local maven repo, and generates appropriate poms. This
    is the official central repository builder for Eclipse plugins, so it has
    the necessary default values. For customized repositories see
    MakeArtifactsMojo Typical usage: mvn eclipse:to-maven
    -DdeployTo=maven.org::default::scpexe://repo1.maven.org/home/maven/repository-staging/to-ibiblio/eclipse-staging
    -DeclipseDir=.
For more information, run 'mvn help:describe [...] -Ddetail'
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.887 s
[INFO] Finished at: 2017-09-22T11:10:52+08:00
[INFO] Final Memory: 11M/150M
[INFO] ------------------------------------------------------------------------

 

转载于:https://www.cnblogs.com/yitouniu/p/7573885.html

你可能感兴趣的文章
Perl包和模块
查看>>
Java内存模型
查看>>
(FFOS Gecko) - several ways of exposing a module to navigator
查看>>
JAVA微信服务号开发简记
查看>>
C# bootstrap之表格动态绑定值
查看>>
C语言中静态申请内存遇到的错误分析
查看>>
UVa 10878 - Decode the tape
查看>>
《Python黑帽子:黑客与渗透测试编程之道》 扩展Burp代理
查看>>
支持鼠标拖拽滑动的jQuery焦点图
查看>>
超酷Loading进度条
查看>>
访问子节点childNodes
查看>>
Bate敏捷冲刺每日报告--day5
查看>>
【THUSC2017】巧克力
查看>>
Lintcode---将二叉树拆成链表
查看>>
网络层使用的协议
查看>>
mac Java环境配置
查看>>
memcached了解及使用及命令
查看>>
Yukari's Birthday 枚举+二分 过程注意数据的溢出问题 HDU4430
查看>>
Python python 数据类型--集
查看>>
48.UIButton上的字体居右对齐
查看>>