Gradle has an interface called DependencySet
that Spring's dependency-management-plugin
can use in a dependencies
block in a dependencyManagement
block like below. (Code from here for reference.)
dependencyManagement {
dependencies {
dependencySet(group:'org.slf4j', version: '1.7.7') {
entry 'slf4j-api'
entry 'slf4j-simple'
}
}
}
This is a very pretty to group dependencies that are in the same group. The more dependencies in the group the prettier it gets. Projects tend to have a lot of dependencies from the same group, especially if you are using Spring. Is there any way to use a similar notation in the "real" dependencies block?
I am afraid there isn't a way how to use dependencySet
outside of the dependencyManagement
section added by the Spring dependency-management-plugin
plugin.
You can take a look at the following classes to see how the dependencies are being read from the script:
dependencies()
The interface for dependencySet
is used differently in Gradle. For example it is returned when you want to know all dependencies from a configuration.
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