首页 > 解决方案 > 如何排除模块 cxf-rt-transports-http

问题描述

我在 build.gradle 中有以下依赖项:

compile ('org.apache.cxf:cxf-bundle:2.4.2')  {

        exclude module: 'log4j-over-slf4j'

    }

由于库之间的冲突(使用 HTTPConduit),我还想排除包含 transports-http 的模块。我试图排除它,但我认为我没有正确的模块名称

标签: gradlebuild.gradle

解决方案


dependencies任务将为您提供依赖关系报告,您可以在其中查看正在提取哪些传递依赖关系。

./gradlew dependencies --configuration compileClasspath

如果您要检查该任务的输出,您会发现它org.apache.cxf:cxf-bundle似乎没有引入cxf-rt-transports-http. 因此,您需要检查您的项目以找出重复依赖项的位置。

Gradle 还提供了一种处理版本冲突的方法:https ://docs.gradle.org/current/userguide/viewing_debugging_dependencies.html#sec:resolving-version-conflict


推荐阅读