gpt4 book ai didi

java - 删除 gradle 中的传递类路径依赖

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:14:57 25 4
gpt4 key购买 nike

我们正在使用 gradle 运行一个 spring-boot 应用。

为了包含 spring-boot 插件,我们将其添加为依赖项:

buildscript {
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.2.RELEASE")
}
}

不幸的是,这个插件依赖于org.apache.logging.log4j:log4j-slf4j-impl:2.4.1

我想排除的。

已经尝试通过添加:

  dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.2.RELEASE") {
exclude group: 'org.apache.logging.log4j'
}
}

这是行不通的。

同时添加:

configurations {
classpath.exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j-impl'
}

没有任何影响。

欢迎任何提示。

最佳答案

如果你想排除

org.apache.logging.log4j:log4j-slf4j-impl:2.4.1

尝试

dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.3.2.RELEASE") {
exclude group: 'org.apache.logging.log4j', module: 'log4j-slf4j-impl'
}
}

关于java - 删除 gradle 中的传递类路径依赖,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35038027/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com