11buildscript {
2- ext. kotlinVersion = ' 2.2.21'
3- ext. isCI = System . getenv(' GITHUB_ACTION' )
2+ ext. kotlinVersion = ' 2.3.10'
43 repositories {
54 gradlePluginPortal()
65 mavenCentral()
7- if (version. endsWith(' SNAPSHOT' )) {
8- maven { url ' https://repo.spring.io/snapshot' }
9- }
106 }
117 dependencies {
128 classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion "
@@ -17,31 +13,20 @@ buildscript {
1713plugins {
1814 id ' base'
1915 id ' idea'
20- id ' org.ajoberstar.grgit' version ' 5.3.3'
21- id ' io.spring.nohttp' version ' 0.0.11'
22- id ' io.spring.dependency-management' version ' 1.1.7' apply false
2316 id ' io.freefair.aggregate-javadoc' version ' 9.2.0'
2417 id ' io.spring.nullability' version ' 0.0.12' apply false
2518}
2619
27- apply plugin : ' io.spring.nohttp'
28-
2920description = ' Spring for Apache Kafka'
3021
3122ext {
3223 linkHomepage = ' https://github.com/spring-projects/spring-kafka'
33- linkCi = ' https://build. spring.io/browse/SK '
24+ linkCi = ' https://github.com/ spring-projects/spring-kafka/actions/workflows/ci-snapshot.yml '
3425 linkIssue = ' https://github.com/spring-projects/spring-kafka/issues'
3526 linkScmUrl = ' https://github.com/spring-projects/spring-kafka'
3627 linkScmConnection = ' https://github.com/spring-projects/spring-kafka.git'
3728 linkScmDevConnection = ' git@github.com:spring-projects/spring-kafka.git'
3829
39- javadocLinks = [
40- ' https://docs.oracle.com/en/java/javase/17/docs/api/' ,
41- ' https://jakarta.ee/specifications/platform/11/apidocs/' ,
42- ' https://docs.spring.io/spring-framework/docs/current/javadoc-api/'
43- ] as String []
44-
4530 assertjVersion = ' 3.27.7'
4631 awaitilityVersion = ' 4.3.0'
4732 hamcrestVersion = ' 3.0'
6954
7055}
7156
72- nohttp {
73- source. include ' **/src/**'
74- source. exclude ' **/*.gif' , ' **/*.ks' , ' **/.gradle/**'
75- }
76-
7757allprojects {
7858 group = ' org.springframework.kafka'
7959
80- apply plugin : ' io.spring.dependency-management'
81-
8260 repositories {
8361 mavenCentral()
8462 maven { url ' https://repo.spring.io/milestone' }
@@ -89,26 +67,28 @@ allprojects {
8967// maven { url 'https://repository.apache.org/content/groups/staging/' }
9068 }
9169
92- dependencyManagement {
93- resolutionStrategy {
94- cacheChangingModulesFor 0 , ' seconds'
95- }
96- applyMavenExclusions = false
97- generatedPomCustomization {
98- enabled = false
70+ configurations {
71+ dependencyManagement {
72+ canBeConsumed = false
73+ canBeResolved = false
9974 }
10075
101- imports {
102- mavenBom " com.fasterxml.jackson:jackson-bom:$jacksonBomVersion "
103- mavenBom " tools.jackson:jackson-bom:$jackson3Version "
104- mavenBom " org.junit:junit-bom:$junitJupiterVersion "
105- mavenBom " io.micrometer:micrometer-bom:$micrometerVersion "
106- mavenBom " io.micrometer:micrometer-tracing-bom:$micrometerTracingVersion "
107- mavenBom " io.projectreactor:reactor-bom:$reactorVersion "
108- mavenBom " org.springframework.data:spring-data-bom:$springDataVersion "
109- mavenBom " org.springframework:spring-framework-bom:$springVersion "
76+ configureEach {
77+ resolutionStrategy. cacheChangingModulesFor 0 , ' minutes'
11078 }
11179 }
80+
81+ dependencies {
82+ dependencyManagement(platform(" com.fasterxml.jackson:jackson-bom:$jacksonBomVersion " ))
83+ dependencyManagement(platform(" tools.jackson:jackson-bom:$jackson3Version " ))
84+ dependencyManagement(platform(" org.junit:junit-bom:$junitJupiterVersion " ))
85+ dependencyManagement(platform(" org.springframework:spring-framework-bom:$springVersion " ))
86+ dependencyManagement(platform(" io.projectreactor:reactor-bom:$reactorVersion " ))
87+ dependencyManagement(platform(" org.apache.logging.log4j:log4j-bom:$log4jVersion " ))
88+ dependencyManagement(platform(" org.springframework.data:spring-data-bom:$springDataVersion " ))
89+ dependencyManagement(platform(" io.micrometer:micrometer-bom:$micrometerVersion " ))
90+ dependencyManagement(platform(" io.micrometer:micrometer-tracing-bom:$micrometerTracingVersion " ))
91+ }
11292}
11393
11494configure(javaProjects) { subproject ->
@@ -146,28 +126,31 @@ configure(javaProjects) { subproject ->
146126 }
147127 }
148128
149-
150129 eclipse. project. natures + = ' org.springframework.ide.eclipse.core.springnature'
151130
131+ configurations {
132+ [compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath]. each {
133+ it. extendsFrom(dependencyManagement)
134+ }
135+ }
136+
152137 // dependencies that are common across all java projects
153138 dependencies {
139+ def spotBugs = ' com.github.spotbugs:spotbugs-annotations:4.9.8'
140+ runtimeOnly spotBugs
141+ testRuntimeOnly spotBugs
142+
154143 testImplementation ' org.junit.jupiter:junit-jupiter-api'
155144 testImplementation ' org.junit.jupiter:junit-jupiter-params'
156- testRuntimeOnly ' org.junit.jupiter:junit-jupiter-engine'
157- testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
158-
159- // To avoid compiler warnings about @API annotations in JUnit code
160- testCompileOnly ' org.apiguardian:apiguardian-api:1.0.0'
161-
162- testRuntimeOnly " org.apache.logging.log4j:log4j-slf4j-impl:$log4jVersion "
163-
164145 testImplementation ' org.jetbrains.kotlin:kotlin-reflect'
165146 testImplementation ' org.jetbrains.kotlin:kotlin-stdlib-jdk8'
166- testImplementation(" org.awaitility:awaitility:$awaitilityVersion " ) {
167- exclude group : ' org.hamcrest'
168- }
147+ testImplementation " org.awaitility:awaitility:$awaitilityVersion "
169148 testImplementation " org.hamcrest:hamcrest-core:$hamcrestVersion "
170- optionalApi " org.assertj:assertj-core:$assertjVersion "
149+ testImplementation " org.assertj:assertj-core:$assertjVersion "
150+
151+ testRuntimeOnly ' org.junit.jupiter:junit-jupiter-engine'
152+ testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
153+ testRuntimeOnly ' org.apache.logging.log4j:log4j-slf4j-impl'
171154 }
172155
173156 // enable all compiler warnings; individual projects may customize further
@@ -240,30 +223,20 @@ project ('spring-kafka') {
240223 api ' org.springframework:spring-tx'
241224 api " org.apache.kafka:kafka-clients:$kafkaVersion "
242225 api ' io.micrometer:micrometer-observation'
226+
243227 optionalApi " org.apache.kafka:kafka-streams:$kafkaVersion "
244228 optionalApi " org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$kotlinCoroutinesVersion "
245229 optionalApi ' com.fasterxml.jackson.core:jackson-core'
246230 optionalApi ' com.fasterxml.jackson.core:jackson-databind'
247231 optionalApi ' com.fasterxml.jackson.datatype:jackson-datatype-jdk8'
248232 optionalApi ' com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
249233 optionalApi ' com.fasterxml.jackson.datatype:jackson-datatype-joda'
250- optionalApi (' com.fasterxml.jackson.module:jackson-module-kotlin' ) {
251- exclude group : ' org.jetbrains.kotlin'
252- }
253-
234+ optionalApi ' com.fasterxml.jackson.module:jackson-module-kotlin'
254235 optionalApi ' tools.jackson.core:jackson-databind'
255236 optionalApi ' tools.jackson.datatype:jackson-datatype-joda'
256- optionalApi(' tools.jackson.module:jackson-module-kotlin' ) {
257- exclude group : ' org.jetbrains.kotlin'
258- }
259-
260- // Spring Data projection message binding support
261- optionalApi (' org.springframework.data:spring-data-commons' ) {
262- exclude group : ' org.springframework'
263- exclude group : ' io.micrometer'
264- }
237+ optionalApi ' tools.jackson.module:jackson-module-kotlin'
238+ optionalApi ' org.springframework.data:spring-data-commons'
265239 optionalApi " com.jayway.jsonpath:json-path:$jaywayJsonPathVersion "
266-
267240 optionalApi ' io.projectreactor:reactor-core'
268241 optionalApi ' io.micrometer:micrometer-core'
269242 optionalApi ' io.micrometer:micrometer-tracing'
@@ -272,9 +245,7 @@ project ('spring-kafka') {
272245 testImplementation ' io.projectreactor:reactor-test'
273246 testImplementation " org.mockito:mockito-junit-jupiter:$mockitoVersion "
274247 testImplementation " org.hibernate.validator:hibernate-validator:$hibernateValidationVersion "
275- testImplementation (' io.micrometer:micrometer-tracing-integration-test' ) {
276- exclude group : ' org.mockito'
277- }
248+ testImplementation ' io.micrometer:micrometer-tracing-integration-test'
278249 }
279250
280251 tasks. withType(JavaForkOptions ) {
@@ -290,7 +261,7 @@ project('spring-kafka-bom') {
290261
291262 dependencies {
292263 constraints {
293- javaProjects. sort { " $ it . name " }. each {
264+ javaProjects. sort { it. name }. each {
294265 api it
295266 }
296267 }
@@ -312,7 +283,6 @@ project ('spring-kafka-test') {
312283 api " org.slf4j:slf4j-api:$slf4jVersion "
313284 api ' org.springframework:spring-context'
314285 api ' org.springframework:spring-test'
315-
316286 api " org.apache.kafka:kafka-clients:$kafkaVersion :test"
317287 api " org.apache.kafka:kafka-server:$kafkaVersion "
318288 api " org.apache.kafka:kafka-test-common-runtime:$kafkaVersion "
@@ -322,9 +292,11 @@ project ('spring-kafka-test') {
322292 api " org.apache.kafka:kafka-streams-test-utils:$kafkaVersion "
323293 api ' org.junit.jupiter:junit-jupiter-api'
324294 api ' org.junit.platform:junit-platform-launcher'
295+
325296 optionalApi " org.hamcrest:hamcrest-core:$hamcrestVersion "
326297 optionalApi " org.mockito:mockito-core:$mockitoVersion "
327- optionalApi " org.apache.logging.log4j:log4j-core:$log4jVersion "
298+ optionalApi ' org.apache.logging.log4j:log4j-core'
299+ optionalApi " org.assertj:assertj-core:$assertjVersion "
328300 }
329301}
330302
@@ -362,6 +334,8 @@ dependencies {
362334 }
363335}
364336
337+ configurations. javadocClasspath. extendsFrom(configurations. dependencyManagement)
338+
365339javadoc {
366340 title = " ${ rootProject.description} ${ version} API"
367341 options {
@@ -372,12 +346,19 @@ javadoc {
372346 use = true
373347 overview = ' src/api/overview.html'
374348 splitIndex = true
375- links(project. ext. javadocLinks)
349+ links(' https://docs.oracle.com/en/java/javase/17/docs/api/' ,
350+ ' https://jakarta.ee/specifications/platform/11/apidocs/' ,
351+ ' https://docs.spring.io/spring-framework/docs/current/javadoc-api/' )
376352 addBooleanOption(' Xdoclint:syntax' , true ) // only check syntax with doclint
377353 }
378354
379355 destinationDir = file(' build/api' )
380- classpath = files(). from { files(javaProjects. collect { it. sourceSets. main. compileClasspath }) }
356+
357+ notCompatibleWithConfigurationCache(' Task requires resolving transitive dependencies from all subprojects' )
358+
359+ doFirst {
360+ classpath + = files(javaProjects. collect { it. sourceSets. main. compileClasspath })
361+ }
381362}
382363
383364tasks. register(' api' ) {
@@ -408,17 +389,17 @@ tasks.register('distZip', Zip) {
408389 description = " Builds -${ archiveClassifier} archive, containing all jars and docs, " +
409390 " suitable for community download page."
410391
411- ext . baseDir = " ${ project.name} -${ project.version} "
392+ def baseDir = " ${ project.name} -${ project.version} "
412393
413394 from(' src/dist' ) {
414395 include ' readme.txt'
415396 include ' notice.txt'
416- into " ${ baseDir} "
397+ into baseDir
417398 }
418399
419400 from(" $project . rootDir " ) {
420401 include ' LICENSE.txt'
421- into " ${ baseDir} "
402+ into baseDir
422403 }
423404
424405 from(zipTree(docsZip. archiveFile)) {
0 commit comments