1

Duplicate class. How to solve this? Build failed, thanks.

implementation 'org.springframework:spring-web:5.1.9.RELEASE'
implementation 'org.springframework:spring-context:5.1.9.RELEASE'
implementation 'org.apache.httpcomponents:httpclient:4.5.9'

Duplicate class org.apache.commons.logging.Log found in modules commons-logging-1.2.jar (commons-logging:commons-logging:1.2) and spring-jcl-5.1.9.RELEASE.jar (org.springframework:spring-jcl:5.1.9.RELEASE) Duplicate class org.apache.commons.logging.LogFactory found in modules commons-logging-1.2.jar (commons-logging:commons-logging:1.2) and spring-jcl-5.1.9.RELEASE.jar (org.springframework:spring-jcl:5.1.9.RELEASE) Duplicate class org.apache.commons.logging.LogFactory$1 found in modules commons-logging-1.2.jar (commons-logging:commons-logging:1.2) and spring-jcl-5.1.9.RELEASE.jar (org.springframework:spring-jcl:5.1.9.RELEASE) Duplicate class org.apache.commons.logging.impl.NoOpLog found in modules commons-logging-1.2.jar (commons-logging:commons-logging:1.2) and spring-jcl-5.1.9.RELEASE.jar (org.springframework:spring-jcl:5.1.9.RELEASE) Duplicate class org.apache.commons.logging.impl.SimpleLog found in modules commons-logging-1.2.jar (commons-logging:commons-logging:1.2) and spring-jcl-5.1.9.RELEASE.jar (org.springframework:spring-jcl:5.1.9.RELEASE)

Jose Simoes
  • 11
  • 1
  • 3
  • 1
    You can exclude certain dependency from another dependency. Take a look at: https://stackoverflow.com/questions/21764128/how-do-i-exclude-all-instances-of-a-transitive-dependency-when-using-gradle – mate00 Aug 07 '19 at 13:25

1 Answers1

0
 Duplicate class org.apache.commons.logging.LogFactory found in modules jetified-commons-logging-1.2.jar (commons-logging:commons-logging:1.2) and jetified-spring-jcl-5.1.8.RELEASE.jar (org.springframework:spring-jcl:5.1.8.RELEASE)
  Duplicate class org.apache.commons.logging.LogFactory$1 found in modules jetified-commons-logging-1.2.jar (commons-logging:commons-logging:1.2) and jetified-spring-jcl-5.1.8.RELEASE.jar (org.springframework:spring-jcl:5.1.8.RELEASE)
  Duplicate class org.apache.commons.logging.impl.NoOpLog found in modules jetified-commons-logging-1.2.jar (commons-logging:commons-logging:1.2) and jetified-spring-jcl-5.1.8.RELEASE.jar (org.springframework:spring-jcl:5.1.8.RELEASE)
  Duplicate class org.apache.commons.logging.impl.SimpleLog found in modules jetified-commons-logging-1.2.jar (commons-logging:commons-logging:1.2) and jetified-spring-jcl-5.1.8.RELEASE.jar (org.springframework:spring-jcl:5.1.8.RELEASE)

The class files in the two packages in the dependencies are duplicated, delete either one to solve this issue. You can rename one .jar as .zip to delete .class files

Lsaiah
  • 11
  • 2