Skip to content

Commit 22ece06

Browse files
Phillip Webbrwinch
authored andcommitted
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 b20b741 commit 22ece06

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

build.gradle

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,41 @@ project("spring-aspects") {
787787
}
788788
}
789789

790+
project("spring-framework-bom") {
791+
description = "Spring Framework (Bill of Materials)"
792+
793+
configurations.archives.artifacts.clear()
794+
artifacts {
795+
// work around GRADLE-2406 by attaching text artifact
796+
archives(file("spring-framework-bom.txt"))
797+
}
798+
799+
install {
800+
repositories.mavenInstaller {
801+
pom.whenConfigured {
802+
packaging = "pom"
803+
withXml {
804+
asNode().children().last() + {
805+
delegate.dependencyManagement {
806+
delegate.dependencies {
807+
parent.subprojects.sort { "$it.name" }.each { p ->
808+
if (p.hasProperty("merge") && p.merge.into == null && p != project) {
809+
delegate.dependency {
810+
delegate.groupId(p.group)
811+
delegate.artifactId(p.name)
812+
delegate.version(p.version)
813+
}
814+
}
815+
}
816+
}
817+
}
818+
}
819+
}
820+
}
821+
}
822+
}
823+
}
824+
790825
configure(rootProject) {
791826
description = "Spring Framework"
792827

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ include "spring-web"
2222
include "spring-webmvc"
2323
include "spring-webmvc-portlet"
2424
include "spring-webmvc-tiles3"
25+
include "spring-framework-bom"
2526

2627
// Exposes gradle buildSrc for IDE support
2728
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)