Skip to content

Commit cf676e5

Browse files
garyrussellartembilan
authored andcommitted
Add spring-kafka-bom
1 parent 606146c commit cf676e5

File tree

4 files changed

+46
-6
lines changed

4 files changed

+46
-6
lines changed

build.gradle

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ ext {
8383
zookeeperVersion = '3.6.3'
8484

8585
idPrefix = 'kafka'
86+
87+
javaProjects = subprojects - project(':spring-kafka-bom')
88+
8689
}
8790

8891
nohttp {
@@ -127,10 +130,10 @@ allprojects {
127130

128131
}
129132

130-
subprojects { subproject ->
133+
configure(javaProjects) { subproject ->
131134
apply plugin: 'java-library'
132135
apply plugin: 'java'
133-
apply from: "${rootProject.projectDir}/publish-maven.gradle"
136+
apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle"
134137
apply plugin: 'eclipse'
135138
apply plugin: 'idea'
136139
apply plugin: 'jacoco'
@@ -356,6 +359,35 @@ project ('spring-kafka') {
356359

357360
}
358361

362+
project('spring-kafka-bom') {
363+
description = 'Spring for Apache Kafka (Bill of Materials)'
364+
365+
apply plugin: 'java-platform'
366+
apply from: "${rootDir}/gradle/publish-maven.gradle"
367+
368+
dependencies {
369+
constraints {
370+
javaProjects.sort { "$it.name" }.each {
371+
if (it.name != 'spring-kafka-docs') {
372+
api it
373+
}
374+
}
375+
}
376+
}
377+
378+
publishing {
379+
publications {
380+
mavenJava(MavenPublication) {
381+
from components.javaPlatform
382+
}
383+
}
384+
}
385+
386+
sonarqube {
387+
skipProject = true
388+
}
389+
}
390+
359391
project ('spring-kafka-test') {
360392
description = 'Spring Kafka Test Support'
361393

@@ -544,11 +576,11 @@ task api(type: Javadoc) {
544576
addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
545577
}
546578

547-
source subprojects.collect { project ->
579+
source javaProjects.collect { project ->
548580
project.sourceSets.main.allJava
549581
}
550582

551-
classpath = files(subprojects.collect { project ->
583+
classpath = files(javaProjects.collect { project ->
552584
project.sourceSets.main.compileClasspath
553585
})
554586
destinationDir = new File(buildDir, 'api')
@@ -602,13 +634,19 @@ task distZip(type: Zip, dependsOn: [docsZip]) { //, schemaZip]) {
602634
into "${baseDir}/docs"
603635
}
604636

605-
subprojects.each { subproject ->
637+
javaProjects.each { subproject ->
606638
into ("${baseDir}/libs") {
607639
from subproject.jar
608640
from subproject.sourcesJar
609641
from subproject.javadocJar
610642
}
611643
}
644+
645+
from(project(':spring-kafka-bom').generatePomFileForMavenJavaPublication) {
646+
into "${baseDir}/libs"
647+
rename 'pom-default.xml', "spring-kafka-bom-${project.version}.xml"
648+
}
649+
612650
}
613651

614652
artifacts {
@@ -621,7 +659,7 @@ task dist(dependsOn: assemble) {
621659
description = 'Builds -dist, -docs distribution archives.'
622660
}
623661

624-
apply from: "${rootProject.projectDir}/publish-maven.gradle"
662+
apply from: "${rootProject.projectDir}/gradle/publish-maven.gradle"
625663

626664
publishing {
627665
publications {
File renamed without changes.

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,6 @@ gradleEnterprise {
2020
rootProject.name = 'spring-kafka-dist'
2121

2222
include 'spring-kafka'
23+
include 'spring-kafka-bom'
2324
include 'spring-kafka-test'
2425
include 'spring-kafka-docs'

spring-kafka-bom/spring-amqp-bom.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This meta-project is used to generate a bill-of-materials POM that contains the other projects in a dependencyManagement section.

0 commit comments

Comments
 (0)