Problem with connecting robovm-rt library

49 Views Asked by At

When I connect the new library robovm-rt, gradle swears that I already have several such classes in another library:

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)

I tried to exclude these Apache classes from library in different ways, but none of them work, the problem remains. Not working options:

Option 1:

implementation (group: 'com.mobidevelop.robovm', name: 'robovm-rt', version: '2.3.5') {
        exclude group: 'commons-logging', module: 'commons-logging'
    }

Option 2:

implementation (group: 'com.mobidevelop.robovm', name: 'robovm-rt', version: '2.3.5') {
        exclude group: 'org.apache.commons', module: 'commons-logging'
    }

What is the correct way to exclude these classes so that they are not duplicated?

1

There are 1 best solutions below

0
Dannik On

Answering my question, I just excluded the module not from the first library, but from the second one - spring-boot-starter-websocket

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