I have a project that uses the Spring Dependency Management Plugin in a multi-project Gradle build to specify consistent dependency versions for the projects.
Per the documentation, when multiple dependencies share the same group & version, a dependency set should be used:
When you want to provide dependency management for multiple modules with the same group and version you should use a dependency set. Using a dependency set removes the need to specify the same group and version multiple times, as shown in the following example:
dependencyManagement {
dependencies {
dependencySet(group:'org.slf4j', version: '1.7.7') {
entry 'slf4j-api'
entry 'slf4j-simple'
}
}
}
The project uses two dependencies that share a group and version, but one of the items also specifies a classifier:
dependencies {
annotationProcessor 'com.querydsl:querydsl-apt:4.2.2:general'
implementation 'com.querydsl:querydsl-mongodb:4.2.2'
}
If there's a way to use a dependencySet
in this case, I haven't found it in the documentation or an online search:
dependencyManagement {
dependencies {
dependencySet(group:'com.querydsl', version: '4.2.2') {
entry 'querydsl-apt' // Can I specify that this uses the "general" classifier?
entry 'querydsl-mongodb'
}
}
}
So in short, is there a way to use a dependencySet
when one of the dependencies requires a classifier, and what is the syntax for doing so?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…