0
votes

In my build.gradle , for one of the direct dependency A , "jersey-client" 2.25.1 is transitive dependency. But when I do gradle build it downloads 2.7 version, when I check dependency A pom, it has only 2.25.1 version, how Gradle resolves it to 2.7?

There are versions above 2.7 as well in the artifactory, how only 2.7 is downloaded?

Only dependency A is using jersey-client.

Cleared gradle cache and tried, but same result.

2

2 Answers

0
votes

There's probably another dependency in your dependency graph bringing in a later version. Try running

gradle dependencies

And it should show some insight into why it chose the newer version. Gradle has a few strategies allowing you to force a particular version of a dependency or perhaps ignoring transitive dependencies of a particular dependency should you wish to do so

0
votes

Spring dependency management plugin is overriding jersey 2.25.1 with 2.7,
I have explicitly declared in my build.gradle file to use 2.25.1 by adding the below property.

ext['jersey.version'] = '2.25.1'