The scenario. I write LibraryA which needs to use a newer version of a library (Caffeine in this case, and specifically v2.6.2). I will build and upload this artifact to our build artifactory
LibraryA is intended to be used by other teams (unknown to me) in an older Spring Boot 1.5 environment . The issue is that Spring Boot internally uses an older version of Caffeine 2.3.5 (although to me , it could use a newer one).
What I see is at runtime, the older version dominates the newer version resulting in class not found exceptions in my lib
Is there a way, I can force my library to always use the newer desired Caffeine version . This would be easy to do if I had control over the code using my library but I'd like to accomplish this within the scope of my library. I tried all the dependency resolution strategies in the gradle documentaion but they are always overridden by the invoking (spring-boot) application