How to 'synchronize' versions of external module dependencies


I am looking for a rather tricky dependency resolution problem. I have a project with a dependency to an external module A (which has a dependency to an external module B) and another dependency to an extension/service of the external module B (which has also a dependency to the core module B) - let’s call it B2, i.e., the dependency graph is something like this

I am currently picking latest.milestone of A from the repository and it’s dependency defines the version of B to use. But how do I specify the version of my explicit B2 dependency which must have the same version as B?

I am not able to force the usage of the version of A’s transitive dependency to B (at least I do not know how to specify the force flag for a transitive dependency). And in a resolution strategy (DependencyResolveDetails or ComponentSelection) I am not able to access the resolvedConfiguration’s firstLevelModuleDependencies (as we are still in the state of resolving them).

Any hint?


Give my suggestion here a try.