I am experiencing a problem with Maven where the library com.google.guava
is being referenced about half a dozen times across multiple layers of transitive dependencies in my project A. Almost all of those dependencies require the age-old version 18.0
.
I have written another dependency B that is being used in project A as well.
This dependency directly depends on version 28.0
of com.google.guava
, but Maven still chooses 18.0
over the much newer version.
Unless I explicitly include the newer version in all projects depending on B, the library will be nonfunctional due to NoMethodError
s and such. If I do so I will probably experience problems with all other libraries because of the new, binary incompatible version of the dependency.
Effectively, I am experiencing group pressure to use the old version of the dependency because everyone else does it.
Why would Maven not choose the newest version instead? What can I do to convince Maven to use the newer version in all projects depending on B?
Is there a way to separate concerns and have all other dependencies actually use 18.0
while my dependency uses 28.0
?
If just a slightly larger package size is the prize to pay for more modern libraries across the projects...
Maybe there is a possibility to hard-link a certain dependency version for my library B, so only my library uses the newer version?