Browse Source

Remove scope information from published BOM

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
pull/23772/head
Brian Clozel 5 years ago
parent
commit
ab58e29397
  1. 6
      framework-bom/framework-bom.gradle

6
framework-bom/framework-bom.gradle

@ -18,6 +18,12 @@ publishing { @@ -18,6 +18,12 @@ publishing {
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())
}
}
}
}
}
Loading…
Cancel
Save