国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【Maven】查看插件配置參數(shù)

這篇具有很好參考價值的文章主要介紹了【Maven】查看插件配置參數(shù)。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報違法"按鈕提交疑問。

背景

工作中使用到很多的Maven插件,雖然可以從網(wǎng)上拷貝別人的配置來用,但是想要深入了解一個插件一共有哪些可用的配置參數(shù),就無從下手了。

當(dāng)然可以從插件的官方網(wǎng)站查看幫助手冊,也可以通過Mavenhelp命令查看插件幫助,包括插件的簡略和詳細(xì)的描述信息,也可以查看插件所有的目標(biāo)goal,以及插件的配置參數(shù)等。

幫助命令

在命令行下面,使用Mavenhelp:describe目標(biāo)查看插件信息:mvn help:describe -Dplugin=插件標(biāo)識

  • 通過plugin參數(shù)指定要查看的插件,插件標(biāo)識可以是groupId:artifactId[:version]形式的,
  • 其中version是可選的,
  • 也可以是插件前綴,
  • 它是插件的簡稱,
  • 插件前綴和插件是一一對應(yīng)的,
  • 這種對應(yīng)關(guān)系存儲在Maven倉庫元數(shù)據(jù)中:https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
  • 比如插件前綴help和插件maven-help-plugin是對應(yīng)的
<plugin>
  <name>Apache Maven Help Plugin</name>
  <prefix>help</prefix>
  <artifactId>maven-help-plugin</artifactId>
</plugin>

使用舉例

下面查看maven-help-plugin插件的信息,即查看幫助命令自己的信息,下面兩條命令是等價的:

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

輸出查詢結(jié)果如下

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-help-plugin:3.2.0:describe (default-cli) @ standalone-pom ---
[INFO] org.apache.maven.plugins:maven-help-plugin:3.2.0
 
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.2.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. If verbose, a comment
    is added to each XML element describing the origin of the line.
 
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'
 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.613 s
[INFO] Finished at: 2021-10-12T15:38:22+08:00
[INFO] ------------------------------------------------------------------------

可以看到maven-help-plugin對應(yīng)的插件前綴是help

Group Id: org.apache.maven.plugins
Artifact Id: maven-help-plugin
Version: 3.2.0
Goal Prefix: help

可以看到help:describe用來查看插件的屬性和目標(biāo)

help:describe
  Description: Displays a list of the attributes for a Maven Plugin and/or
    goals (aka Mojo - Maven plain Old Java Object).
  • 可以看到help命令自帶的幫助: mvn help:help
  • 輸出的結(jié)果基本和上面的相同
  • 這里更推薦使用help:describe命令

查看詳細(xì)信息

通過在命令后追加-Ddetail參數(shù),可以查看插件的詳細(xì)信息:

簡略信息:
mvn help:describe -Dplugin=help
詳細(xì)信息:
mvn help:describe -Dplugin=help -Ddetail

詳細(xì)信息輸出如下,這是可以看到每個goal的配置參數(shù)說明

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-help-plugin:3.2.0:describe (default-cli) @ standalone-pom ---
[INFO] org.apache.maven.plugins:maven-help-plugin:3.2.0
 
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.2.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.
  Implementation: org.apache.maven.plugins.help.ActiveProfilesMojo
  Language: java
 
  Available parameters:
 
    output
      User property: output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.
 
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.
  Implementation: org.apache.maven.plugins.help.AllProfilesMojo
  Language: java
 
  Available parameters:
 
    output
      User property: output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.
 
help:describe
  Description: Displays a list of the attributes for a Maven Plugin and/or
    goals (aka Mojo - Maven plain Old Java Object).
  Implementation: org.apache.maven.plugins.help.DescribeMojo
  Language: java
 
  Available parameters:
 
    artifactId
      User property: artifactId
      The Maven Plugin artifactId to describe.
      Note: Should be used with groupId parameter.
 
    cmd
      User property: cmd
      A Maven command like a single goal or a single phase following the Maven
      command line:
      mvn [options] [<goal(s)>] [<phase(s)>]
 
    detail (Default: false)
      User property: detail
      This flag specifies that a detailed (verbose) list of goal (Mojo)
      information should be given.
 
    goal
      User property: goal
      The goal name of a Mojo to describe within the specified Maven Plugin. If
      this parameter is specified, only the corresponding goal (Mojo) will be
      described, rather than the whole Plugin.
 
    groupId
      User property: groupId
      The Maven Plugin groupId to describe.
      Note: Should be used with artifactId parameter.
 
    minimal (Default: false)
      User property: minimal
      This flag specifies that a minimal list of goal (Mojo) information should
      be given.
 
    output
      User property: output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.
 
    plugin
      Alias: prefix
      User property: plugin
      The Maven Plugin to describe. This must be specified in one of three
      ways:
 
      1.  plugin-prefix, i.e. 'help'
      2.  groupId:artifactId, i.e. 'org.apache.maven.plugins:maven-help-plugin'
      3.  groupId:artifactId:version, i.e.
        'org.apache.maven.plugins:maven-help-plugin:2.0'
 
    version
      User property: version
      The Maven Plugin version to describe.
      Note: Should be used with groupId/artifactId parameters.
 
help:effective-pom
  Description: Displays the effective POM as an XML for this build, with the
    active profiles factored in, or a specified artifact. If verbose, a comment
    is added to each XML element describing the origin of the line.
  Implementation: org.apache.maven.plugins.help.EffectivePomMojo
  Language: java
 
  Available parameters:
 
    artifact
      User property: artifact
      The artifact for which to display the effective POM.
      Note: Should respect the Maven format, i.e. groupId:artifactId[:version].
      The latest version of the artifact will be used when no version is
      specified.
 
    output
      User property: output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.
 
    verbose (Default: false)
      User property: verbose
      Output POM input location as comments.
 
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.
  Implementation: org.apache.maven.plugins.help.EffectiveSettingsMojo
  Language: java
 
  Available parameters:
 
    output
      User property: output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.
 
    showPasswords (Default: false)
      User property: showPasswords
      For security reasons, all passwords are hidden by default. Set this to
      true to show all passwords.
 
help:evaluate
  Description: Evaluates Maven expressions given by the user in an
    interactive mode.
  Implementation: org.apache.maven.plugins.help.EvaluateMojo
  Language: java
 
  Available parameters:
 
    artifact
      User property: artifact
      An artifact for evaluating Maven expressions.
      Note: Should respect the Maven format, i.e. groupId:artifactId[:version].
      The latest version of the artifact will be used when no version is
      specified.
 
    expression
      User property: expression
      An expression to evaluate instead of prompting. Note that this must not
      include the surrounding ${...}.
 
    forceStdout (Default: false)
      User property: forceStdout
      This options gives the option to output information in cases where the
      output has been suppressed by using -q (quiet option) in Maven. This is
      useful if you like to use maven-help-plugin:evaluate in a script call
      (for example in bash) like this:
      RESULT=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
      echo $RESULT
      This will only printout the information which has been requested by
      expression to stdout.
 
    output
      User property: output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console. This parameter will be ignored if no
      expression is specified.
      Note: Could be a relative path.
 
help:help
  Description: Display help information on maven-help-plugin.
    Call mvn help:help -Ddetail=true -Dgoal=<goal-name> to display parameter
    details.
  Implementation: org.apache.maven.plugins.help.HelpMojo
  Language: java
 
  Available parameters:
 
    detail (Default: false)
      User property: detail
      If true, display all settable properties for each goal.
 
    goal
      User property: goal
      The name of the goal for which to show help. If unspecified, all goals
      will be displayed.
 
    indentSize (Default: 2)
      User property: indentSize
      The number of spaces per indentation level, should be positive.
 
    lineLength (Default: 80)
      User property: lineLength
      The maximum length of a display line, should be positive.
 
help:system
  Description: Displays a list of the platform details like system properties
    and environment variables.
  Implementation: org.apache.maven.plugins.help.SystemMojo
  Language: java
 
  Available parameters:
 
    output
      User property: output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.
 
 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.904 s
[INFO] Finished at: 2021-10-12T15:53:53+08:00
[INFO] ------------------------------------------------------------------------

查看指定目標(biāo)

可以通過-Dgoal參數(shù),查看指定目標(biāo)的詳細(xì)信息:

簡略信息:
mvn help:describe -Dplugin=help -Dgoal=describe
詳細(xì)信息:
mvn help:describe -Dplugin=help -Dgoal=describe -Ddetail

簡略信息輸出如下

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-help-plugin:3.2.0:describe (default-cli) @ standalone-pom ---
[INFO] Mojo: 'help:describe'
help:describe
  Description: Displays a list of the attributes for a Maven Plugin and/or
    goals (aka Mojo - Maven plain Old Java Object).
 
For more information, run 'mvn help:describe [...] -Ddetail'
 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.031 s
[INFO] Finished at: 2021-10-12T15:56:50+08:00
[INFO] ------------------------------------------------------------------------

詳細(xì)信息輸出如下

[INFO] Scanning for projects...
[INFO]
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO]
[INFO] --- maven-help-plugin:3.2.0:describe (default-cli) @ standalone-pom ---
[INFO] Mojo: 'help:describe'
help:describe
  Description: Displays a list of the attributes for a Maven Plugin and/or
    goals (aka Mojo - Maven plain Old Java Object).
  Implementation: org.apache.maven.plugins.help.DescribeMojo
  Language: java
 
  Available parameters:
 
    artifactId
      User property: artifactId
      The Maven Plugin artifactId to describe.
      Note: Should be used with groupId parameter.
 
    cmd
      User property: cmd
      A Maven command like a single goal or a single phase following the Maven
      command line:
      mvn [options] [<goal(s)>] [<phase(s)>]
 
    detail (Default: false)
      User property: detail
      This flag specifies that a detailed (verbose) list of goal (Mojo)
      information should be given.
 
    goal
      User property: goal
      The goal name of a Mojo to describe within the specified Maven Plugin. If
      this parameter is specified, only the corresponding goal (Mojo) will be
      described, rather than the whole Plugin.
 
    groupId
      User property: groupId
      The Maven Plugin groupId to describe.
      Note: Should be used with artifactId parameter.
 
    minimal (Default: false)
      User property: minimal
      This flag specifies that a minimal list of goal (Mojo) information should
      be given.
 
    output
      User property: output
      Optional parameter to write the output of this help in a given file,
      instead of writing to the console.
      Note: Could be a relative path.
 
    plugin
      Alias: prefix
      User property: plugin
      The Maven Plugin to describe. This must be specified in one of three
      ways:
 
      1.  plugin-prefix, i.e. 'help'
      2.  groupId:artifactId, i.e. 'org.apache.maven.plugins:maven-help-plugin'
      3.  groupId:artifactId:version, i.e.
        'org.apache.maven.plugins:maven-help-plugin:2.0'
 
    version
      User property: version
      The Maven Plugin version to describe.
      Note: Should be used with groupId/artifactId parameters.
 
 
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.162 s
[INFO] Finished at: 2021-10-12T15:57:13+08:00
[INFO] ------------------------------------------------------------------------

其他命令

該幫助插件還有很多有用的goal,下面僅列出幾個常用的,更多的請自行嘗試。文章來源地址http://www.zghlxwxcb.cn/news/detail-617417.html

  • 查看當(dāng)前pom.xml具體生效的結(jié)果,并且輸出到文件: mvn help:effective-pom -Doutput=EffectivePom.xml
  • 查看pom中生效的profile: mvn help:active-profiles -N
  • 查看系統(tǒng)所有環(huán)境變量: mvn help:system

到了這里,關(guān)于【Maven】查看插件配置參數(shù)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 用Intellij/Maven插件查看測試覆蓋率和測試報告

    目錄 概覽 Intellij Maven 配置 查看測試報告 用maven插件 用Jacoco (Java Code Coverage)

    2024年02月15日
    瀏覽(17)
  • Idea使用Docker插件實(shí)現(xiàn)maven打包自動構(gòu)建鏡像

    Idea使用Docker插件實(shí)現(xiàn)maven打包自動構(gòu)建鏡像

    Docker 開啟TCP 服務(wù) 改寫以下內(nèi)容 重啟服務(wù) 此時docker已經(jīng)開放了2375端口,使用外部主機(jī)訪問 http://docker:2375/info IDEA 集成Docker 安裝Docker 插件 配置docker服務(wù)地址 點(diǎn)擊view-services,打開docker的操作面板 雙擊docker01可以看到此docker服務(wù)下鏡像和容器 右擊docker鏡像,可以創(chuàng)建新的容器,

    2024年02月10日
    瀏覽(31)
  • Maven項(xiàng)目構(gòu)建工具

    Maven項(xiàng)目構(gòu)建工具

    目錄 ????????1.Maven介紹 ????????????????1.1Maven是什么 ????????????????1.2為什么要使用maven ????????2.Maven安裝 ????????????????2.1下載Maven: ????????????????2.2解壓并配置 ????????????????2.3編輯Maven環(huán)境變量 ??????????????

    2024年01月20日
    瀏覽(18)
  • 【Maven教程】(一)入門介紹篇:Maven基礎(chǔ)概念與其他構(gòu)建工具:理解構(gòu)建過程與Maven的多重作用,以及與敏捷開發(fā)的關(guān)系 ~

    【Maven教程】(一)入門介紹篇:Maven基礎(chǔ)概念與其他構(gòu)建工具:理解構(gòu)建過程與Maven的多重作用,以及與敏捷開發(fā)的關(guān)系 ~

    \\\" Maven \\\"可以翻譯為 “知識的積累者” 或 “專家”。這個詞源于波斯語,意為廣受尊重和富有智慧的人。在軟件開發(fā)領(lǐng)域中,Maven作為Apache 組織中的一個頗為成功的開源項(xiàng)目,它是一個非常流行的構(gòu)建工具,它在項(xiàng)目管理、依賴管理和構(gòu)建自動化方面提供了強(qiáng)大的功能和支持

    2024年02月12日
    瀏覽(91)
  • Spring Boot各版本與Java版本的對應(yīng)兼容關(guān)系,與構(gòu)建工具(Maven、Gradle)版本的對應(yīng)兼容關(guān)系,對servlet 容器的支持

    Spring Boot各版本與Java版本的對應(yīng)兼容關(guān)系,與構(gòu)建工具(Maven、Gradle)版本的對應(yīng)兼容關(guān)系,對servlet 容器的支持

    by:垃圾程序員 當(dāng)前文章具有時效性,在當(dāng)前springboot的版本下做的整合。之后大家視情況可以直接到Spring的官網(wǎng)查看 Spring | Home Level up your Java code and explore what Spring can do for you. https://spring.io/ 下面是Spring Boot各個版本的支持時間 下面是Spring Boot 推薦使用的各個版面,并標(biāo)注出

    2024年02月10日
    瀏覽(152)
  • 使用docker-maven-plugin插件構(gòu)建鏡像并推送至私服Harbor

    使用docker-maven-plugin插件構(gòu)建鏡像并推送至私服Harbor

    如下所示,建議使用 Dockerfile Maven 插件,但該插件也停止維護(hù)更新了。因此先暫時使用 docker-maven-plugin 插件。 默認(rèn)的dokcer是不支持遠(yuǎn)程訪問的,需要加點(diǎn)配置,開啟Docker的遠(yuǎn)程訪問 確定docker配置文件位置在:/etc/systemd/system/docker.service 然后編輯修改docker配置文件: 找到包含

    2024年02月11日
    瀏覽(20)
  • 新一代構(gòu)建工具 maven-mvnd

    新一代構(gòu)建工具 maven-mvnd

    maven 作為一代經(jīng)典的構(gòu)建工具,流行了很多年,知道現(xiàn)在依然是大部分Java項(xiàng)目的構(gòu)建工具的首選;但隨著項(xiàng)目復(fù)雜度提高,代碼量及依賴庫的增多使得maven在大型項(xiàng)目的構(gòu)建的速度上被人詬病。 因此推出了gradle之類的項(xiàng)目,雖然gradle在構(gòu)建效率是高于maven,但是在一般的小項(xiàng)

    2024年02月14日
    瀏覽(34)
  • Maven的安裝、配置以及在Eclipse中安裝maven插件

    Maven的安裝、配置以及在Eclipse中安裝maven插件

    一、需要準(zhǔn)備的東西 (原文鏈接) 1.首先確保安裝了JDK,并且成功配置了JDK的環(huán)境變量。 2. 已安裝Eclipse 3. Maven程序包 二、maven下載與安裝 1. 前往https://maven.apache.org/download.cgi下載最新版的Maven程序: 2. 將文件解壓到D:Program FilesApachemaven目錄下: 3. 新建環(huán)境變量MAVEN_HOME,賦值

    2023年04月14日
    瀏覽(26)
  • Jenkins——maven 插件配置

    Jenkins——maven 插件配置

    在 Jenkins 上構(gòu)建 Java 項(xiàng)目時需要使用 Maven 來進(jìn)行構(gòu)建打包 1、下載 maven 程序壓縮包 2、解壓 maven 壓縮包 3、配置環(huán)境變量 詳細(xì)操作步驟: https://blog.csdn.net/YZL40514131/article/details/130080838 1、進(jìn)入菜單 Dashboard——》系統(tǒng)管理(Manage Jenkins)——》插件管理(Manage Plugins) 2、在可選

    2024年02月09日
    瀏覽(20)
  • 構(gòu)建SpringBoot工程時找不到插件“spring-boot-maven-plugin”

    構(gòu)建SpringBoot工程時找不到插件“spring-boot-maven-plugin”

    目錄 一、找不到插件“spring-boot-maven-plugin” 二、再次啟動時,又發(fā)現(xiàn)報錯 ????????Unable to find a single main class from the following candidates [com.itheima.Application, com.example.springboot01.Springboot01Application]上面報錯的意思是,有多個App類,它不知用哪個 ?三、把該插件打包后,在jar包的

    2024年02月07日
    瀏覽(135)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包