本文介绍了排除导入依赖关系管理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

我有一个漂亮的BOM表,在它的dependencyManagement部分中有很多依赖项,我想创建另一个BOM表,以导入除以外的所有依赖项.我尝试这样做:

I have a beautiful BOM with a lot of dependencies in its dependencyManagement section and I would like to create another BOM that imports all that dependencies except one. I tried doing this:

... in my dependencyManagement section
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-dependencies</artifactId>
    <version>${spring-boot-version}</version>
    <type>pom</type>
    <scope>import</scope>

    <exclusions>
        <exclusion>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        </exclusion>
    </exclusions>
</dependency>
...

POM在形式上是正确的,并且所有内容都可以编译. 但是,将忽略该排除.我想念什么?这种方法正确吗?

The POM is formally correct and everything compiles. But the exclusion is simply ignored. What am I missing? Is this approach correct?

我正在使用Maven 3 +.

I'm using Maven 3+.

推荐答案

导入时排除不起作用,请尝试将其从依赖项的实际用户中排除

Exclusion at import won't work, try excluding it from the actual user of the dependency

这篇关于排除导入依赖关系管理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-06 22:14