0

Say I have a two direct dependencies A and B to my project, where one of the direct dependencies (say A) depends on package X version 3, and the other (say B) depends on package X version 4 and package X 4 has breaking changes compared to package X version 3, therefore it is not possible to apply a resolution strategy to transitive dependencies to force one or the other version.

Is it possible to isolate/hide the transitive to package X below package A and B so that the project does not see X, and package B does not see X version 3 and package A does not see X version 4 ?

Pinco Pallino
  • 916
  • 1
  • 6
  • 18
  • I don't think this is possible. If it would be possible, then it would lead to class collisions as libraries in multiple versions would bring classes in same packages, with different implementations. Usually you have to upgrade/downgrade all libs using lib X to state without breaking changes. – Vaclav Stengl Sep 12 '22 at 12:33
  • I don't really understand your example (it's very abstract; proper names and a diagram might help) but I think you can create Gradle subprojects to isolate incompatible dependencies, and expose an API that provides the functionality of the dependencies that you require. The 'core' subproject can depend on the 'client' subprojects. – aSemy Sep 12 '22 at 21:50

0 Answers0