【问题标题】:Exclude specific directory/path in gradle dependency排除 gradle 依赖项中的特定目录/路径
【发布时间】:2021-07-06 08:43:56
【问题描述】:

我的依赖项中有一个implementation 依赖项。该依赖项具有旧版本的 apache commons-lang 3 依赖项阴影。它没有被列为依赖的传递依赖,它只是被遮蔽了。但是,我也需要 apache commons-lang 3 依赖项,而且我需要更新的版本。我不认为我可以排除 commons-lang 3 依赖项,因为它不是传递的。有没有其他过滤依赖的方法?

使用 gradle 7.1

【问题讨论】:

    标签: java gradle gradle-kotlin-dsl


    【解决方案1】:

    试试你的 例子:

      <dependency>
                <groupId>xxxx</groupId>
                <artifactId>xxxx</artifactId>
                <version>1.0.9-SNAPSHOT</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.commons-lang</groupId>
                        <artifactId>XXX</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
    

    【讨论】:

    • 对不起,我忘了说我没有使用 maven
    猜你喜欢
    • 2018-04-06
    • 1970-01-01
    • 2021-12-25
    • 1970-01-01
    • 1970-01-01
    • 2018-10-18
    • 1970-01-01
    • 1970-01-01
    • 2017-09-08
    相关资源
    最近更新 更多