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:

  1. revert using jersey 1.x , it's implementation of jsr311
  2. 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

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -