"Nearest" Transitive Dependency Resolution


(Adrian Abraham) #1

I see that the resolution DSL has added the ability to easily force specific versions of individual dependencies. But, what I really want to do is to “force” EVERY dependency listed for a project (I think this is called “nearest” dependency resolution).

Suppose ChildProject depends on CoolThing 1.1 and on ParentProject, and ParentProject depends on CoolThing 1.2. I want ChildProject to get CoolThing 1.1 automatically, without my having to force it. For just one dependency, forcing isn’t a huge deal - but I’m dealing with a legacy project, and we have LOADS of conflicting dependencies like this.

We’re gradually working to fix these, but until they’re all properly fixed, the “latest” transitive resolution is causing problems for us, so we’ve had to disable transitive dependency resolution altogether. We’d LOVE to be able to enable it, if we can just figure out how to get around this …


#2

Hi. Sorry to say, but Gradle dependency resolution does not currently support the “nearest” strategy for conflict resolution. Your current options are to force the version (like you’re doing) or to declare some of the dependencies using Client Module syntax.


(Adrian Abraham) #3

Is this on the roadmap?


#4

Better maven support is on the roadmap, and since ‘nearest’ resolution is how Maven does it, we’ll probably need to make it possible in Gradle as well. But it’s not on our short-term radar.