Say we have a large dependency graph in which Scala dependencies
foo:bar_2.10:6.0 are pulled in transitively. These two modules are the same for all intents and purposes, but can’t natively be resolved by Gradle. As far as I can tell, there’s no Gradle API to directly flatten these two prior to dependency resolution.
Our current approach is to add a dummy
Action<DependencyResolveDetails that parses all transitive dependencies, and stores them in memory for other dependency resolution actions to use. We then can force all instances
foo:bar_2.10:6.0, picking the one with the highest version.
There are two points we would like help with:
- Is there an easier/cleaner way to go through all of our transitive dependencies prior to dependency resolution? We would like to avoid resolving dependencies multiple times.
- Is our rule of flattening varianted dependencies into the highest version in-line with Gradle’s expected module resolution?