【发布时间】:2021-05-28 21:04:59
【问题描述】:
当我连接新库 robovm-rt 时,gradle 发誓我已经在另一个库中有几个这样的类:
Duplicate class org.apache.commons.logging.Log found in modules robovm-rt-2.3.5 (com.mobidevelop.robovm:robovm-rt:2.3.5) and spring-jcl-5.1.2.RELEASE (org.springframework:spring-jcl:5.1.2.RELEASE)
Duplicate class org.apache.commons.logging.LogFactory found in modules robovm-rt-2.3.5 (com.mobidevelop.robovm:robovm-rt:2.3.5) and spring-jcl-5.1.2.RELEASE (org.springframework:spring-jcl:5.1.2.RELEASE)
Duplicate class org.apache.commons.logging.LogFactory$1 found in modules robovm-rt-2.3.5 (com.mobidevelop.robovm:robovm-rt:2.3.5) and spring-jcl-5.1.2.RELEASE (org.springframework:spring-jcl:5.1.2.RELEASE)
Duplicate class org.apache.commons.logging.impl.NoOpLog found in modules robovm-rt-2.3.5 (com.mobidevelop.robovm:robovm-rt:2.3.5) and spring-jcl-5.1.2.RELEASE (org.springframework:spring-jcl:5.1.2.RELEASE)
Duplicate class org.apache.commons.logging.impl.SimpleLog found in modules robovm-rt-2.3.5 (com.mobidevelop.robovm:robovm-rt:2.3.5) and spring-jcl-5.1.2.RELEASE (org.springframework:spring-jcl:5.1.2.RELEASE)
我试图以不同的方式从库中排除这些 Apache 类,但它们都不起作用,问题仍然存在。不工作的选项:
选项 1:
implementation (group: 'com.mobidevelop.robovm', name: 'robovm-rt', version: '2.3.5') {
exclude group: 'commons-logging', module: 'commons-logging'
}
选项 2:
implementation (group: 'com.mobidevelop.robovm', name: 'robovm-rt', version: '2.3.5') {
exclude group: 'org.apache.commons', module: 'commons-logging'
}
排除这些类以免重复的正确方法是什么?
【问题讨论】:
标签: spring gradle build robovm