简体   繁体   English

如何在使用Maven BOM文件时指定插件依赖项的版本

[英]how to specify the version of a plugin dependency when using Maven BOM files

I have a Maven BOM file which I import into my project pom: 我有一个Maven BOM文件,我将其导入到我的项目pom中:

     <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>be.company.mvn</groupId>
                <artifactId>be.company.mvn.bom.core</artifactId>
                <version>1.0.0-SNAPSHOT</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>

works fine for dependencies, and even for plugins. 适用于依赖项,甚至适用于插件。 But now I also want to control the version of the dependency of a plugin used in project pom: 但是现在我还想控制项目pom中使用的插件的依赖版本:

   <build>
     <plugins>
       <plugin>
         <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-maven-plugin</artifactId>

         <dependencies>
           <dependency>
             <groupId>commons-dbcp</groupId>
             <artifactId>commons-dbcp</artifactId>
           </dependency>
       </plugin>

Is it possible to get this working? 有可能让这个工作吗? I want to specify the version of commons-dbcp in my BOM file without having to specify it as a dependency of the jetty plugin in the BOM file too. 我想在BOM文件中指定commons-dbcp的版本,而不必将其指定为BOM文件中jetty插件的依赖项。

There is an opened issue for that MNG-5588 (opened in Feb 2014...). MNG-5588 (2014年2月开业......)已经开启了一个问题。 Feel free to vote for it. 随意投票。 At the moment, only a "classic" parent pluginsManagement can be used. 目前,只能使用“经典”父插件管理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM