gpt4 book ai didi

gradle - 从Gradle 6.4.1中的jar中排除软件包

转载 作者:行者123 更新时间:2023-12-03 05:20:16 25 4
gpt4 key购买 nike

我正在使用Gradle 6.4.1,并且在org.apache.drill.exec:drill-jdbc-all:1.18.0和spring-boot-starter-data-jpa中的com.jayway.jsonpath包中出现冲突。
所以我想从drill-jdbc-all.jar中排除com.jayway.jsonpath包

 compile ('org.apache.drill.exec:drill-jdbc-all:1.18.0') {
exclude group: 'com.jayway.jsonpath'
exclude module: 'json-path'
}
compile group: 'com.jayway.jsonpath', name: 'json-path', version: '2.4.0'
甚至尝试过
configurations {
all {
compile.exclude module: 'com.jayway.jsonpath'
}
}
但仍然显示
类层次结构是从以下位置加载的:
    com.jayway.jsonpath.spi.mapper.JacksonMappingProvider: file:/Users/abc/.gradle/caches/modules-2/files-2.1/org.apache.drill.exec/drill-jdbc-all/1.18.0/6a0b608238f4a431684cd73d132d7467bc2c3967/drill-jdbc-all-1.18.0.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of com.jayway.jsonpath.spi.mapper.JacksonMappingProvider

最佳答案

根据6.4.1文档的Excluding transitive dependencies部分,尝试一下:

dependencies {
...
implementation('org.apache.drill.exec:drill-jdbc-all:1.18.0') {
exclude group: 'com.jayway.jsonpath', module: 'json-path'
}
...
}

关于gradle - 从Gradle 6.4.1中的jar中排除软件包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63810191/

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