I’m assuming the question is in the context of a multi-project build?
Something that seems to be somewhat of a convention (the gradle source uses this in their build files) is to define some project extension properties on the root project, i.e. something like:
log4jVersion = "1.2.17"
groovyVersion = "2.0.5"
you can then either apply these to all subprojects in the same file:
//in the same build.gradle as the above ext definition
apply plugin: 'groovy'
or use them in a build.gradle for a specific sub project:
This is assuming that your various subprojects do not have the exact same dependencies, but differing subsets of the dependencies but you would always like for a specific dependency (like log4j above) to be fixed to a specific, globally configured version.