Using Gradle, I'd like to be able to disable transitivity on one group of dependencies, while still allowing on others. Something like this:
// transitivity enabled
compile(
[group: 'log4j', name: 'log4j', version: '1.2.16'],
[group: 'commons-beanutils', name: 'commons-beanutils', version: '1.7.0']
)
// transitivity disabled
compile(
[group: 'commons-collections', name: 'commons-collections', version: '3.2.1'],
[group: 'commons-lang', name: 'commons-lang', version: '2.6'],
) {
transitive = false
}
Gradle won't accept this syntax. I can get it to work if I do this:
compile(group: 'commons-collections', name: 'commons-collections', version: '3.2.1') { transitive = false }
compile(group: 'commons-lang', name: 'commons-lang', version: '2.6']) { transitive = false }
But that requires me to specify the property on each dependency, when I'd rather group them together.
Anyone have a suggestion for a syntax that will work on this?