连接 robovm-rt 库的问题

问题描述

当我连接新库 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',version: '2.3.5') {
        exclude group: 'org.apache.commons',module: 'commons-logging'
    }

排除这些类以使它们不重复的正确方法是什么?

解决方法

回答我的问题,我只是从第一个库中而不是从第二个库中排除了模块 - spring-boot-starter-websocket

implementation('org.springframework.boot:spring-boot-starter-websocket') {
        exclude group: 'org.springframework',module: 'spring-jcl'
    }

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...