Skip to content

Commit 92e144a

Browse files
author
Phillip Webb
committed
Add a 'bill of materials' project for Maven users
Add 'spring-framework-bom' meta-project that contains the other projects in a dependencyManagement section. Issue: SPR-11138
1 parent 079fb2d commit 92e144a

3 files changed

Lines changed: 38 additions & 0 deletions

File tree

‎build.gradle‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,41 @@ project("spring-aspects") {
853853
}
854854
}
855855

856+
project("spring-framework-bom") {
857+
description = "Spring Framework (Bill of Materials)"
858+
859+
configurations.archives.artifacts.clear()
860+
artifacts {
861+
// work around GRADLE-2406 by attaching text artifact
862+
archives(file("spring-framework-bom.txt"))
863+
}
864+
865+
install {
866+
repositories.mavenInstaller {
867+
pom.whenConfigured {
868+
packaging = "pom"
869+
withXml {
870+
asNode().children().last() + {
871+
delegate.dependencyManagement {
872+
delegate.dependencies {
873+
parent.subprojects.sort { "$it.name" }.each { p ->
874+
if (p.hasProperty("merge") && p.merge.into == null && p != project) {
875+
delegate.dependency {
876+
delegate.groupId(p.group)
877+
delegate.artifactId(p.name)
878+
delegate.version(p.version)
879+
}
880+
}
881+
}
882+
}
883+
}
884+
}
885+
}
886+
}
887+
}
888+
}
889+
}
890+
856891
configure(rootProject) {
857892
description = "Spring Framework"
858893

‎settings.gradle‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ include "spring-webmvc"
2323
include "spring-webmvc-portlet"
2424
include "spring-webmvc-tiles3"
2525
include "spring-websocket"
26+
include "spring-framework-bom"
2627

2728
// Exposes gradle buildSrc for IDE support
2829
include "buildSrc"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This meta-project is used to generate a bill-of-materials POM that contains the other
2+
projects in a dependencyManagement section.

0 commit comments

Comments
 (0)