java - Exclude Package From Gradle Dependency -
i'm experiencing issue multiple versions of same class showing in classpath. class in question javax.ws.rs.core.uribuilder
. version want use brought in javax.ws.rs:javax.ws.rs-api:2.0.1
. however, use jira rest client library has dependency on older version of jersey (com.sun.jersey:jersey-core
) has included java.ws packages bundled in it's jar.
here example snippet build file:
dependencies { compile 'com.atlassian.jira:jira-rest-java-client-core:2.0.0-m31' compile 'javax.ws.rs:javax.ws.rs-api:2.0.1' compile 'org.glassfish.jersey.core:jersey-client:2.17' }
i can't remove com.sun.jersey:jersey-core
uses different package name new version , cause class def not found exceptions in jira client.
as far can tell, options @ point are:
- revert using jersey 1.x , it's implementation of jsr311
- somehow have gradle exclude
javax.ws
package old jersey client.
i'd keep using newer version of jersey #2 ideal solution i'm not sure if it's possible. know how go this? if that's not possible, i'm open other suggestions.
you can exclude transitive dependency module this:
compile ('org.glassfish.jersey.core:jersey-client:2.17') { exclude group: 'javax.ws.rs' exclude module: 'javax.ws.rs-api' }
ref: 50.4.7 here
Comments
Post a Comment