Is there a good pattern to reuse dependency blocks in gradle? at the moment there is a lot of repetition ( same blocks in different modules - application / tests / .. ) Is there a way to define these dependencies in a central place and reuse them in the modules?
You can group dependencies into a list for instance and the pass this list for given configuration:
apply plugin: 'java'
repositories {
mavenCentral()
}
ext.forDI = [
'com.google.inject:guice:3.0',
'com.google.guava:guava:18.0'
]
dependencies {
compile(forDI)
}
This question might be also helpful for you and this as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With