From 7d83b1432c43edf20094d7ddbb3886135b069a9d Mon Sep 17 00:00:00 2001 From: Janne Valkealahti Date: Tue, 14 Feb 2017 13:00:03 +0000 Subject: [PATCH] Add dependencies bom - Fixes #317 --- build.gradle | 44 +++++++++++++++++++ settings.gradle | 1 + .../spring-statemachine-bom.txt | 2 + 3 files changed, 47 insertions(+) create mode 100644 spring-statemachine-bom/spring-statemachine-bom.txt diff --git a/build.gradle b/build.gradle index 0966677e..a56d9c40 100644 --- a/build.gradle +++ b/build.gradle @@ -387,6 +387,50 @@ project('spring-statemachine-recipes-common') { } } +project('spring-statemachine-bom') { + description = "Spring Statemachine (Bill of Materials)" + + dependencyManagement { + generatedPomCustomization { + enabled = false + } + } + + configurations.archives.artifacts.clear() + artifacts { + // work around GRADLE-2406 by attaching text artifact + archives(file("spring-statemachine-bom.txt")) + } + + install { + repositories.mavenInstaller { + pom.whenConfigured { + packaging = "pom" + withXml { + asNode().children().last() + { + delegate.dependencyManagement { + delegate.dependencies { + parent.subprojects.sort { "$it.name" }.each { p -> + if (!p.name.contains('spring-statemachine-samples') && + !p.name.contains('spring-statemachine-build-tests') && + p != project) { + delegate.dependency { + delegate.groupId(p.group) + delegate.artifactId(p.name) + delegate.version(p.version) + } + } + } + } + } + } + } + } + } + } + +} + configure(sampleProjects()) { apply plugin: 'org.springframework.boot' configurations.archives.artifacts.removeAll { it.archiveTask.is jar } diff --git a/settings.gradle b/settings.gradle index 2ac87c9a..19a2b38f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -10,6 +10,7 @@ include 'spring-statemachine-uml' include 'spring-statemachine-build-tests' include 'spring-statemachine-recipes' include 'spring-statemachine-boot' +include 'spring-statemachine-bom' include 'spring-statemachine-samples' include 'spring-statemachine-samples:turnstile' diff --git a/spring-statemachine-bom/spring-statemachine-bom.txt b/spring-statemachine-bom/spring-statemachine-bom.txt new file mode 100644 index 00000000..9671db5d --- /dev/null +++ b/spring-statemachine-bom/spring-statemachine-bom.txt @@ -0,0 +1,2 @@ +This meta-project is used to generate a bill-of-materials POM that contains the other +projects in a dependencyManagement section.