Skip to content

Commit 44c2115

Browse files
committed
Main to 3.0; SF 6.0; JDK 17
Initial Commit for Spring Framework 6.0/JDK 17 * PR review comments; build is green. Fix Spring Data version; fix deprecations Fix checkstyle Add mavenCentral() for GE Plugin
1 parent 95fc922 commit 44c2115

File tree

5 files changed

+44
-22
lines changed

5 files changed

+44
-22
lines changed

.github/workflows/pr-build-workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v2
15-
- name: Set up JDK 11
15+
- name: Set up JDK 17
1616
uses: actions/setup-java@v1
1717
with:
18-
java-version: 11
18+
java-version: 17
1919

2020
- name: Run Gradle
2121
uses: burrunan/gradle-cache-action@v1

build.gradle

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ buildscript {
22
ext.kotlinVersion = '1.5.31'
33
repositories {
44
mavenCentral()
5-
maven { url 'https://plugins.gradle.org/m2' }
5+
gradlePluginPortal()
66
maven { url 'https://repo.spring.io/plugins-release' }
77
}
88
dependencies {
@@ -44,6 +44,11 @@ ext {
4444
linkScmDevConnection = '[email protected]:spring-projects/spring-kafka.git'
4545
docResourcesVersion = '0.2.5'
4646

47+
javadocLinks = [
48+
'https://docs.oracle.com/en/java/javase/17/docs/api/',
49+
'https://docs.spring.io/spring-framework/docs/current/javadoc-api/'
50+
] as String[]
51+
4752

4853
if (gitPresent) {
4954
modifiedFiles =
@@ -56,7 +61,7 @@ ext {
5661
hamcrestVersion = '2.2'
5762
hibernateValidationVersion = '6.2.0.Final'
5863
jacksonBomVersion = '2.13.1'
59-
jaywayJsonPathVersion = '2.4.0'
64+
jaywayJsonPathVersion = '2.6.0'
6065
junit4Version = '4.13.2'
6166
junitJupiterVersion = '5.8.2'
6267
kafkaVersion = '3.0.0'
@@ -65,10 +70,10 @@ ext {
6570
mockitoVersion = '4.0.0'
6671
reactorVersion = '2020.0.14'
6772
scalaVersion = '2.13'
68-
springBootVersion = '2.5.7' // docs module
69-
springDataVersion = '2021.1.0'
73+
springBootVersion = '2.6.1-SNAPSHOT' // docs module
74+
springDataVersion = '2022.1.0-SNAPSHOT'
7075
springRetryVersion = '1.3.1'
71-
springVersion = '5.3.14'
76+
springVersion = '6.0.0-SNAPSHOT'
7277
zookeeperVersion = '3.6.3'
7378

7479
idPrefix = 'kafka'
@@ -136,25 +141,25 @@ subprojects { subproject ->
136141
}
137142

138143
compileJava {
139-
sourceCompatibility = 1.8
140-
targetCompatibility = 1.8
144+
sourceCompatibility = 17
145+
targetCompatibility = 17
141146
}
142147

143148
compileTestJava {
144-
sourceCompatibility = 11
149+
sourceCompatibility = 17
145150
options.encoding = 'UTF-8'
146151
}
147152

148153
compileTestKotlin {
149154
kotlinOptions {
150-
jvmTarget = '11'
155+
jvmTarget = '16'
151156
}
152157
}
153158

154159
eclipse.project.natures += 'org.springframework.ide.eclipse.core.springnature'
155160

156161
jacoco {
157-
toolVersion = '0.8.6'
162+
toolVersion = '0.8.7'
158163
}
159164

160165
// dependencies that are common across all java projects
@@ -291,6 +296,11 @@ subprojects { subproject ->
291296
}
292297
}
293298

299+
tasks.withType(Javadoc) {
300+
options.addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
301+
options.addBooleanOption('Werror', true) // fail build on Javadoc warnings
302+
}
303+
294304
}
295305

296306
project ('spring-kafka') {
@@ -374,7 +384,7 @@ project ('spring-kafka-docs') {
374384

375385
compileKotlin {
376386
kotlinOptions {
377-
jvmTarget = '1.8'
387+
jvmTarget = '16'
378388
}
379389
}
380390

@@ -485,10 +495,17 @@ task api(type: Javadoc) {
485495
group = 'Documentation'
486496
description = 'Generates aggregated Javadoc API documentation.'
487497
title = "${rootProject.description} ${version} API"
488-
options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
489-
options.author = true
490-
options.header = rootProject.description
491-
options.overview = 'src/api/overview.html'
498+
options {
499+
encoding = 'UTF-8'
500+
memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED
501+
author = true
502+
header = rootProject.description
503+
use = true
504+
overview = 'src/api/overview.html'
505+
splitIndex = true
506+
links(project.ext.javadocLinks)
507+
addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
508+
}
492509

493510
source subprojects.collect { project ->
494511
project.sourceSets.main.allJava

gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
version=2.8.2-SNAPSHOT
1+
version=3.0.0-SNAPSHOT
2+
org.gradle.jvmargs=-Xmx1536M -Dfile.encoding=UTF-8
23
org.gradle.caching=true
34
org.gradle.parallel=true
45
kotlin.stdlib.default.dependency=false

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pluginManagement {
22
repositories {
3+
mavenCentral()
34
gradlePluginPortal()
45
maven { url 'https://repo.spring.io/plugins-release' }
56
}

spring-kafka-test/src/test/java/org/springframework/kafka/test/hamcrest/KafkaMatchersTests.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@
2323
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasTimestamp;
2424
import static org.springframework.kafka.test.hamcrest.KafkaMatchers.hasValue;
2525

26+
import java.util.Optional;
27+
2628
import org.apache.kafka.clients.consumer.ConsumerRecord;
29+
import org.apache.kafka.common.header.internals.RecordHeaders;
2730
import org.apache.kafka.common.record.TimestampType;
2831
import org.junit.jupiter.api.Test;
2932

@@ -36,8 +39,8 @@ public class KafkaMatchersTests {
3639

3740
@Test
3841
public void testKeyMatcher() {
39-
ConsumerRecord<String, String> record = new ConsumerRecord<>("topic", 0, 10,
40-
1487694048607L, TimestampType.CREATE_TIME, 123L, 2, 3, "key1", "value1");
42+
ConsumerRecord<String, String> record = new ConsumerRecord<>("topic", 0, 10, 1487694048607L,
43+
TimestampType.CREATE_TIME, 2, 3, "key1", "value1", new RecordHeaders(), Optional.empty());
4144
assertThat(record, hasKey("key1"));
4245
assertThat(record, hasValue("value1"));
4346
assertThat(record, hasPartition(0));
@@ -47,8 +50,8 @@ public void testKeyMatcher() {
4750

4851
@Test
4952
public void noMatchOnTimestamp() {
50-
ConsumerRecord<String, String> record = new ConsumerRecord<>("topic", 0, 10,
51-
1487694048607L, TimestampType.CREATE_TIME, 123L, 2, 3, "key1", "value1");
53+
ConsumerRecord<String, String> record = new ConsumerRecord<>("topic", 0, 10, 1487694048607L,
54+
TimestampType.CREATE_TIME, 2, 3, "key1", "value1", new RecordHeaders(), Optional.empty());
5255

5356
assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> assertThat(record, hasTimestamp(123L)))
5457
.withMessageContaining(

0 commit comments

Comments
 (0)