【maven】help插件

11 篇文章 0 订阅

maven当中的help插件可以给我们很多的关于当前项目配置的信息

1. help:effective-pom

这个goal主要目的让我们了解当前项目最终合并后的配置信息,比如,所有的maven项目都会继承super pom,这时候项目的配置都会继承super pom的配置以及覆盖某些配置.

jiangjian@DESKTOP-0IKNJOE MINGW64 /g/maven-practice/simple-weather
$ mvn help:effective-pom
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.jiangjian:simple-weather:jar:1.0-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 73, column 15
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-surefire-plugin is missing. @ line 80, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building simple-weather 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-help-plugin:2.2:effective-pom (default-cli) @ simple-weather ---
[INFO]
Effective POMs, after inheritance, interpolation, and profiles are applied:

<!-- ====================================================================== -->
<!--                                                                        -->
<!-- Generated by Maven Help Plugin on 2017-07-02T12:00:37                  -->
<!-- See: http://maven.apache.org/plugins/maven-help-plugin/                -->
<!--                                                                        -->
<!-- ====================================================================== -->

<!-- ====================================================================== -->
<!--                                                                        -->
<!-- Effective POM for project                                              -->
<!-- 'com.jiangjian:simple-weather:jar:1.0-SNAPSHOT'                        -->
<!--                                                                        -->
<!-- ====================================================================== -->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.jiangjian</groupId>
  <artifactId>simple-weather</artifactId>
  <version>1.0-SNAPSHOT</version>

...省略

2. help:active-profiles

该goal主要用来列举当前项目的所有profile以及它们定义的位置(pom.xml, profiles.xml, ~/m2.settings.xml, ${M2_HOME}/conf/settings.xml)

3. help:effective-settings

该goal显示当前pom.xml最终的配置信息,下面是对应的功能说明:
Description: Displays the calculated settings as XML for this project,
given any profile enhancement and the inheritance of the global settings
into the user-level settings.

4. help:describe

这个goal的目的主要是用来对maven 的插件功能进行查询,比如我们我们需要对help插件提供的功能进行查阅,可以执行如下命令:

mvn help:describe -Dplugin=help

运行结果如下:

Name: Apache Maven Help Plugin
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.
Group Id: org.apache.maven.plugins
Artifact Id: maven-help-plugin
Version: 3.1.0
Goal Prefix: help

This plugin has 8 goals:

help:active-profiles
  Description: Displays a list of the profiles which are currently active for
    this build.

help:all-profiles
  Description: Displays a list of available profiles under the current
    project.
    Note: it will list all profiles for a project. If a profile comes up with a
    status inactive then there might be a need to set profile activation
    switches/property.

help:describe
  Description: Displays a list of the attributes for a Maven Plugin and/or
    goals (aka Mojo - Maven plain Old Java Object).

help:effective-pom
  Description: Displays the effective POM as an XML for this build, with the
    active profiles factored in, or a specified artifact.

help:effective-settings
  Description: Displays the calculated settings as XML for this project,
    given any profile enhancement and the inheritance of the global settings
    into the user-level settings.

help:evaluate
  Description: Evaluates Maven expressions given by the user in an
    interactive mode.

help:help
  Description: Display help information on maven-help-plugin.
    Call mvn help:help -Ddetail=true -Dgoal=<goal-name> to display parameter
    details.

help:system
  Description: Displays a list of the platform details like system properties
    and environment variables.

For more information, run 'mvn help:describe [...] -Ddetail'

后面的提示大家还可以看到追加 -Ddetail显示的信息更加的完全,

5. help:system

该命令用来显示系统的配置信息(包括system properties 和 enviroment properties)

mvn help:system

output:

[INFO] --- maven-help-plugin:2.2:system (default-cli) @ welfare-platform ---
[INFO]
===============================================================================
========================= Platform Properties Details =========================
===============================================================================

===============================================================================
System Properties
===============================================================================

java.runtime.name=Java(TM) SE Runtime Environment
sun.boot.library.path=D:\java\jdk8\jre\bin
java.vm.version=25.121-b13
...此处省略
===============================================================================
Environment Variables
===============================================================================

CLASSWORLDS_JAR="D:\apache-maven-3.3.9\bin\..\boot\plexus-classworlds-2.5.2.jar"
PSMODULEPATH=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PROGRAMW6432=C:\Program Files
COMMONPROGRAMW6432=C:\Program Files\Common Files
MOZ_PLUGIN_PATH=D:\Foxit Reader\plugins\
WINDOWS_TRACING_LOGFILE=C:\BVTBin\Tests\installpackage\csilogfile.log
...此处省略
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值