Resolving dependency conflict in gradle when artifact name is different


(Rajesh Mohanan) #1

We have a project that had a dependency on jersey-core, jersey-client and jersey-server, all for version 1.17

Now we have a need to upgrade to version 1.19.1, but our local repo has jersey-bundle rather than the above 3 for that version.All classes needed for the above 3 are present in the bundle. When I do a build its getting packed with both versions- client core and server with 1.17 and bundle with 1.19.1. Getting separate jars for client, core and server in our repo is not an option right now.

I tried excluding the older version in configurations.all and also tried this in resolutionStrategy

force "com.sun.jersey:jersey-client:1.19.1"
force "com.sun.jersey:jersey-server:1.19.1"
force "com.sun.jersey:jersey-core:1.19.1"

Both failed as there are other dependencies which depend on the older version.
Is there a solution for this?


(Chris Doré) #2

What I think you really want to do is substitute jersey-bundle for any instances of jersey-core, client, or server.

See Substituting a dependency module with a compatible replacement in the User Guide.


Broken links in posts
Broken links in posts