Is there an elegant way to replace a transitive dependency by another?


(Michael Schaefers) #1

Continuing the discussion from Is there a way to replace a transitive dependency by another?:

We are currently facing the exact same problem that @Rafael_Brandao described in 2012 in this old thread. Is there any news on that? @luke_daley gave a very promising answer, saying the requested feature could be added in the future.


(Sterling Greene) #2

Yes, we have a way to declare substitutions of one module for another:

https://docs.gradle.org/current/userguide/dependency_management.html#N1247B

You would either use eachDependency hooks or dependencySubstitution in ResolutionStrategy.


(Michael Schaefers) #3

Thanks a lot, this is exactly what we need.