Exclude Package From Gradle Dependency

前端 未结 2 1922
执念已碎
执念已碎 2021-01-19 00:44

I\'m experiencing an issue where multiple versions of the same class are showing up in my classpath. The class in question is javax.ws.rs.core.UriBuilder. The

2条回答
  •  时光取名叫无心
    2021-01-19 01:11

    I found out that com.sun.jersey:jersey-core:1.19 doesn't bundle the javax.ws.rs class files and instead lists them as a compile-time dependency. Adding this snippet to my build.gradle fixed the issue.

    configurations.all {
      resolutionStrategy {
        // For a version that doesn't package javax.ws
        force 'com.sun.jersey:jersey-core:1.19' 
      }
    }
    

提交回复
热议问题