Skip to content

Commit

Permalink
Remove scope information from published BOM
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bclozel committed Sep 18, 2019
1 parent e1e072b commit ab58e29
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions framework-bom/framework-bom.gradle
Expand Up @@ -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())
}
}
}
}
}

0 comments on commit ab58e29

Please sign in to comment.