So, I’m working in a fairly large organization with lots of projects, some quite small, some rather large. I’ve implemented a uniform build system with Ant+Ivy, later on we switched to Maven. There are many projects and they need to stay similar in constitution, so that the developers can switch projects easily, etc. Many of the developers don’t need to understand the build scripts that much, they mostly just need to change versions of the dependencies. Also, some of our projects are big multi-projects where we need one place to change the dependency version in.
When considering Gradle as a replacement in a situation like this, one thing that to me seems to be missing is something like Maven’s “dependencyManagement”.
Here’s another thread on this subject:
The solutions given there don’t seem satisfactory to me. For one, I want to use the map style when declaring the dependencies. I don’t want to give the developers the task of figuring new names for dependencies. Etc.
So, I’d like to see some way to set at least the versions of the dependencies in the parent pom without creating new variables, etc.
Perhaps something like this in the parent project:
subprojects {
dependencyManagement {
compile group: 'org.hibernate', name: 'hibernate-core', version: '3.6.7.Final'
}
}
Then in a subproject:
subprojects {
dependencies {
compile group: 'org.hibernate', name: 'hibernate-core'
}
}
This would get the version and other attributes from the dependencyManagement.
To think of it, in our case it’s mostly the problem of configuring the version numbers in one place. I don’t like the idea of creating new variables for this. Perhaps someone can come up with a more elegant solution.