It seems that publishing a Gradle platform as a Maven POM writes all dependencies with their scope information by default. We don't want that when publishing the Spring Framework BOM, as it forces the scope on projects depending on the BOM, unless they've specified the scope when they added the dependency to their build. Typically, developers could get spring-test as a compile dependency without this change. This commit removes the scope information from the published BOM. Fixes gh-23660
29 lines
588 B
Groovy
29 lines
588 B
Groovy
description = "Spring Framework (Bill of Materials)"
|
|
|
|
apply plugin: 'java-platform'
|
|
apply from: "$rootDir/gradle/publications.gradle"
|
|
|
|
group = "org.springframework"
|
|
|
|
dependencies {
|
|
constraints {
|
|
parent.moduleProjects.sort { "$it.name" }.each {
|
|
api it
|
|
}
|
|
}
|
|
}
|
|
|
|
publishing {
|
|
publications {
|
|
mavenJava(MavenPublication) {
|
|
artifactId = 'spring-framework-bom'
|
|
from components.javaPlatform
|
|
// remove scope information from published BOM
|
|
pom.withXml {
|
|
asNode().dependencyManagement.first().dependencies.first().each {
|
|
it.remove(it.scope.first())
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |