From ab58e2939795410b9a5b22d53228d31f3ee9d3ce Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Wed, 18 Sep 2019 15:27:59 +0200 Subject: [PATCH] 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 --- framework-bom/framework-bom.gradle | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/framework-bom/framework-bom.gradle b/framework-bom/framework-bom.gradle index 840f20537fa2..bf9d620a807f 100644 --- a/framework-bom/framework-bom.gradle +++ b/framework-bom/framework-bom.gradle @@ -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()) + } + } } } } \ No newline at end of file