Skip to content

Commit b3ae24e

Browse files
committed
Fixes according latest upgrades
* Add `--add-opens` to `asciidoctor` Gradle task to avoid compilation warning * Upgrade to Kotlin `1.6.10` and modify its Gradle task respective * Add empty impl for new `AnnotationMetadataAdapter.getDeclaredMethods()` * Parse HTTP methods to new `String methodNames` property of the `RequestMapping` since `HttpMethod` is not an `enum` anymore. * Ignore JDBC tests which rely on a map property resolution: the `[]` placeholder is not handled in the latest SF anymore. * Fix `WebFluxInboundEndpoint` for deprecations
1 parent a80b226 commit b3ae24e

File tree

17 files changed

+205
-163
lines changed

17 files changed

+205
-163
lines changed

build.gradle

Lines changed: 116 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
buildscript {
2-
ext.kotlinVersion = '1.5.32'
3-
repositories {
4-
mavenCentral()
5-
gradlePluginPortal()
6-
maven { url 'https://repo.spring.io/plugins-release-local' }
7-
}
8-
dependencies {
9-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
10-
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
11-
}
2+
ext.kotlinVersion = '1.6.10'
3+
repositories {
4+
mavenCentral()
5+
gradlePluginPortal()
6+
maven { url 'https://repo.spring.io/plugins-release-local' }
7+
}
8+
dependencies {
9+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
10+
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
11+
}
1212
}
1313

1414
plugins {
15-
id 'org.sonarqube' version '2.8'
16-
id 'io.spring.nohttp' version '0.0.10' apply false
17-
id 'org.ajoberstar.grgit' version '4.1.0'
18-
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
19-
id 'com.jfrog.artifactory' version '4.24.20' apply false
20-
id 'org.jetbrains.dokka' version '1.5.30'
21-
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
22-
id 'org.asciidoctor.jvm.gems' version '3.3.2'
23-
id 'org.asciidoctor.jvm.convert' version '3.3.2'
15+
id 'org.sonarqube' version '2.8'
16+
id 'io.spring.nohttp' version '0.0.10' apply false
17+
id 'org.ajoberstar.grgit' version '4.1.0'
18+
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
19+
id 'com.jfrog.artifactory' version '4.24.20' apply false
20+
id 'org.jetbrains.dokka' version '1.5.30'
21+
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
22+
id 'org.asciidoctor.jvm.gems' version '3.3.2'
23+
id 'org.asciidoctor.jvm.convert' version '3.3.2'
2424
}
2525

2626
if (System.getenv('GITHUB_ACTION') || System.getenv('bamboo_buildKey')) {
@@ -46,66 +46,67 @@ ext {
4646
modifiedFiles =
4747
files(grgit.status().unstaged.modified).filter { f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
4848

49-
apacheSshdVersion = '2.7.0'
50-
artemisVersion = '2.19.0'
51-
aspectjVersion = '1.9.7'
52-
assertjVersion = '3.21.0'
53-
assertkVersion = '0.25'
54-
avroVersion = '1.10.2'
55-
awaitilityVersion = '4.1.1'
56-
commonsDbcp2Version = '2.9.0'
57-
commonsIoVersion = '2.11.0'
58-
commonsNetVersion = '3.8.0'
59-
curatorVersion = '4.3.0'
60-
derbyVersion = '10.14.2.0'
61-
ftpServerVersion = '1.1.1'
62-
googleJsr305Version = '3.0.2'
63-
greenmailVersion = '2.0.0-alpha-2'
64-
groovyVersion = '3.0.9'
65-
hamcrestVersion = '2.2'
66-
hazelcastVersion = '4.2.3'
67-
hibernateVersion = '5.6.1.Final'
68-
hsqldbVersion = '2.6.0'
69-
h2Version = '1.4.200'
70-
jacksonVersion = '2.13.0'
71-
jaxbVersion = '3.0.2'
72-
jeroMqVersion = '0.5.2'
73-
jmsApiVersion = '3.0.0'
74-
jpaApiVersion = '3.0.2'
75-
jrubyVersion = '9.2.19.0'
76-
jschVersion = '0.1.55'
77-
jsonpathVersion = '2.6.0'
78-
junit4Version = '4.13.2'
79-
junitJupiterVersion = '5.8.1'
80-
jythonVersion = '2.7.2'
81-
kryoShadedVersion = '4.0.2'
82-
lettuceVersion = '6.1.6.RELEASE'
83-
log4jVersion = '2.17.1'
84-
mailVersion = '2.0.1'
85-
micrometerVersion = '1.7.8'
86-
mockitoVersion = '4.0.0'
87-
mongoDriverVersion = '4.4.0-beta2'
88-
mysqlVersion = '8.0.27'
89-
pahoMqttClientVersion = '1.2.5'
90-
postgresVersion = '42.2.23'
91-
r2dbch2Version='0.8.4.RELEASE'
92-
reactorVersion = '2020.0.14'
93-
resilience4jVersion = '1.7.1'
94-
romeToolsVersion = '1.16.0'
95-
rsocketVersion = '1.1.1'
96-
saajVersion = '2.0.1'
97-
servletApiVersion = '5.0.0'
98-
smackVersion = '4.3.5'
99-
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '3.0.0-SNAPSHOT'
100-
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : '2022.1.0-SNAPSHOT'
101-
springKafkaVersion = '3.0.0-SNAPSHOT'
102-
springRetryVersion = '1.3.1'
103-
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '6.0.0-SNAPSHOT'
104-
springVersion = project.hasProperty('springVersion') ? project.springVersion : '6.0.0-SNAPSHOT'
105-
springWsVersion = '4.0.0-SNAPSHOT'
106-
tomcatVersion = '10.0.11'
107-
xmlUnitVersion = '2.8.3'
108-
xstreamVersion = '1.4.18'
49+
apacheSshdVersion = '2.7.0'
50+
artemisVersion = '2.19.0'
51+
aspectjVersion = '1.9.7'
52+
assertjVersion = '3.21.0'
53+
assertkVersion = '0.25'
54+
avroVersion = '1.10.2'
55+
awaitilityVersion = '4.1.1'
56+
commonsDbcp2Version = '2.9.0'
57+
commonsIoVersion = '2.11.0'
58+
commonsNetVersion = '3.8.0'
59+
curatorVersion = '4.3.0'
60+
derbyVersion = '10.14.2.0'
61+
ftpServerVersion = '1.1.1'
62+
googleJsr305Version = '3.0.2'
63+
greenmailVersion = '2.0.0-alpha-2'
64+
groovyVersion = '3.0.9'
65+
hamcrestVersion = '2.2'
66+
hazelcastVersion = '5.0.2'
67+
hibernateVersion = '5.6.1.Final'
68+
hsqldbVersion = '2.6.0'
69+
h2Version = '1.4.200'
70+
jacksonVersion = '2.13.0'
71+
jaxbVersion = '3.0.2'
72+
jeroMqVersion = '0.5.2'
73+
jmsApiVersion = '3.0.0'
74+
jpaApiVersion = '3.0.2'
75+
jrubyVersion = '9.2.19.0'
76+
jschVersion = '0.1.55'
77+
jsonpathVersion = '2.6.0'
78+
junit4Version = '4.13.2'
79+
junitJupiterVersion = '5.8.1'
80+
jythonVersion = '2.7.2'
81+
kryoShadedVersion = '4.0.2'
82+
lettuceVersion = '6.1.5.RELEASE'
83+
log4jVersion = '2.17.0'
84+
mailVersion = '2.0.1'
85+
micrometerVersion = '1.7.7'
86+
mockitoVersion = '4.0.0'
87+
mongoDriverVersion = '4.4.0'
88+
mysqlVersion = '8.0.27'
89+
pahoMqttClientVersion = '1.2.5'
90+
postgresVersion = '42.2.23'
91+
r2dbch2Version = '0.9.0.M1'
92+
reactorVersion = '2020.0.14'
93+
resilience4jVersion = '1.7.1'
94+
romeToolsVersion = '1.16.0'
95+
rsocketVersion = '1.1.1'
96+
saajVersion = '2.0.1'
97+
servletApiVersion = '5.0.0'
98+
smackVersion = '4.3.5'
99+
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '3.0.0-SNAPSHOT'
100+
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : '2022.1.0-SNAPSHOT'
101+
springKafkaVersion = '3.0.0-SNAPSHOT'
102+
springRetryVersion = '1.3.1'
103+
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '6.0.0-SNAPSHOT'
104+
springVersion = project.hasProperty('springVersion') ? project.springVersion : '6.0.0-SNAPSHOT'
105+
springWsVersion = '4.0.0-SNAPSHOT'
106+
testcontainersVersion = '1.16.2'
107+
tomcatVersion = '10.0.11'
108+
xmlUnitVersion = '2.8.4'
109+
xstreamVersion = '1.4.18'
109110

110111
javaProjects = subprojects - project(':spring-integration-bom')
111112
}
@@ -204,14 +205,18 @@ configure(javaProjects) { subproject ->
204205

205206
compileKotlin {
206207
kotlinOptions {
208+
languageVersion = '1.6'
209+
apiVersion = '1.6'
207210
jvmTarget = '16'
208-
freeCompilerArgs = ['-Xjsr305=strict']
211+
freeCompilerArgs = ['-Xjsr305=strict', '-Xsuppress-version-warnings', '-Xopt-in=kotlin.RequiresOptIn']
209212
allWarningsAsErrors = true
210213
}
211214
}
215+
212216
compileTestKotlin {
213217
kotlinOptions {
214218
jvmTarget = '16'
219+
freeCompilerArgs = ['-Xjsr305=strict']
215220
}
216221
}
217222

@@ -255,10 +260,10 @@ configure(javaProjects) { subproject ->
255260
testImplementation("com.willowtreeapps.assertk:assertk-jvm:$assertkVersion") {
256261
exclude group: 'org.jetbrains.kotlin'
257262
}
258-
testImplementation 'org.jetbrains.kotlin:kotlin-reflect'
259-
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
260-
testImplementation 'io.projectreactor:reactor-test'
261-
testImplementation "org.testcontainers:junit-jupiter:$testcontainersVersion"
263+
testImplementation 'org.jetbrains.kotlin:kotlin-reflect'
264+
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
265+
testImplementation 'io.projectreactor:reactor-test'
266+
testImplementation "org.testcontainers:junit-jupiter:$testcontainersVersion"
262267

263268
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
264269
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
@@ -349,10 +354,10 @@ configure(javaProjects) { subproject ->
349354
enableAssertions = false
350355
}
351356

352-
checkstyle {
353-
configDirectory.set(rootProject.file('src/checkstyle'))
354-
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '9.2'
355-
}
357+
checkstyle {
358+
configDirectory.set(rootProject.file('src/checkstyle'))
359+
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '9.2'
360+
}
356361

357362
jar {
358363
manifest {
@@ -490,25 +495,25 @@ project('spring-integration-core') {
490495
}
491496
}
492497

493-
dokkaHtmlPartial {
494-
outputDirectory.set(new File(buildDir, 'docs/kdoc'))
495-
dokkaSourceSets {
496-
main {
497-
sourceRoots.setFrom(file('src/main/kotlin'))
498-
classpath.from(sourceSets['main'].runtimeClasspath)
499-
externalDocumentationLink {
500-
url.set(new URL("https://docs.spring.io/spring-integration/docs/$version/api/"))
501-
packageListUrl.set(file("$buildDir/docs/javadoc/element-list").toURI().toURL())
502-
}
503-
externalDocumentationLink {
504-
url.set(new URL('https://projectreactor.io/docs/core/release/api/'))
505-
}
506-
externalDocumentationLink {
507-
url.set(new URL('https://www.reactive-streams.org/reactive-streams-1.0.3-javadoc/'))
508-
}
509-
}
510-
}
511-
}
498+
dokkaHtmlPartial {
499+
outputDirectory.set(new File(buildDir, 'docs/kdoc'))
500+
dokkaSourceSets {
501+
main {
502+
sourceRoots.setFrom(file('src/main/kotlin'))
503+
classpath.from(sourceSets['main'].runtimeClasspath)
504+
externalDocumentationLink {
505+
url.set(new URL("https://docs.spring.io/spring-integration/docs/$version/api/"))
506+
packageListUrl.set(file("$buildDir/docs/javadoc/element-list").toURI().toURL())
507+
}
508+
externalDocumentationLink {
509+
url.set(new URL('https://projectreactor.io/docs/core/release/api/'))
510+
}
511+
externalDocumentationLink {
512+
url.set(new URL('https://www.reactive-streams.org/reactive-streams-1.0.3-javadoc/'))
513+
}
514+
}
515+
}
516+
}
512517
}
513518

514519
project('spring-integration-event') {
@@ -634,7 +639,7 @@ project('spring-integration-jdbc') {
634639
testImplementation "org.postgresql:postgresql:$postgresVersion"
635640
testImplementation "mysql:mysql-connector-java:$mysqlVersion"
636641
testImplementation "org.apache.commons:commons-dbcp2:$commonsDbcp2Version"
637-
testImplementation "org.testcontainers:mysql:$testcontainersVersion"
642+
testImplementation "org.testcontainers:mysql:$testcontainersVersion"
638643

639644
testRuntimeOnly 'com.fasterxml.jackson.core:jackson-databind'
640645
}
@@ -1042,9 +1047,9 @@ task api(type: Javadoc) {
10421047
}
10431048

10441049
dokkaHtmlMultiModule {
1045-
dependsOn api
1046-
moduleName.set('spring-integration')
1047-
outputDirectory.set(file("$buildDir/docs/kdoc"))
1050+
dependsOn api
1051+
moduleName.set('spring-integration')
1052+
outputDirectory.set(file("$buildDir/docs/kdoc"))
10481053
}
10491054

10501055
apply from: "${rootDir}/gradle/docs.gradle"

gradle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ org.gradle.jvmargs=-Xmx1536M -Dfile.encoding=UTF-8
33
org.gradle.caching=true
44
org.gradle.parallel=true
55
kotlin.stdlib.default.dependency=false
6+
kotlin.jvm.target.validation.mode=IGNORE

gradle/docs.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ asciidoctorj {
108108

109109
asciidoctor {
110110
dependsOn asciidoctorPdf
111+
inProcess = JAVA_EXEC
112+
forkOptions {
113+
jvmArgs '--add-opens', 'java.base/sun.nio.ch=ALL-UNNAMED', '--add-opens', 'java.base/java.io=ALL-UNNAMED'
114+
}
111115
baseDirFollowsSourceFile()
112116
configurations 'asciidoctorExt'
113117
sourceDir "$buildDir/asciidoc"

spring-integration-core/src/main/java/org/springframework/integration/config/xml/AnnotationConfigParser.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2021 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,13 +18,15 @@
1818

1919
import java.util.HashMap;
2020
import java.util.Map;
21+
import java.util.Set;
2122

2223
import org.w3c.dom.Element;
2324

2425
import org.springframework.beans.factory.config.BeanDefinition;
2526
import org.springframework.beans.factory.support.BeanDefinitionRegistry;
2627
import org.springframework.beans.factory.xml.BeanDefinitionParser;
2728
import org.springframework.beans.factory.xml.ParserContext;
29+
import org.springframework.core.type.MethodMetadata;
2830
import org.springframework.integration.config.EnablePublisher;
2931
import org.springframework.integration.config.IntegrationRegistrar;
3032
import org.springframework.integration.config.PublisherRegistrar;
@@ -84,6 +86,12 @@ public Map<String, Object> getAnnotationAttributes(String annotationType) {
8486
}
8587
}
8688

89+
90+
@Override
91+
public Set<MethodMetadata> getDeclaredMethods() {
92+
return null;
93+
}
94+
8795
}
8896

8997
}

spring-integration-core/src/main/java/org/springframework/integration/config/xml/MessageHistoryParser.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -18,12 +18,14 @@
1818

1919
import java.util.Collections;
2020
import java.util.Map;
21+
import java.util.Set;
2122

2223
import org.w3c.dom.Element;
2324

2425
import org.springframework.beans.factory.config.BeanDefinition;
2526
import org.springframework.beans.factory.xml.BeanDefinitionParser;
2627
import org.springframework.beans.factory.xml.ParserContext;
28+
import org.springframework.core.type.MethodMetadata;
2729
import org.springframework.integration.config.MessageHistoryRegistrar;
2830
import org.springframework.integration.config.annotation.AnnotationMetadataAdapter;
2931

@@ -51,6 +53,11 @@ public Map<String, Object> getAnnotationAttributes(String annotationType) {
5153
return Collections.singletonMap("value", element.getAttribute("tracked-components"));
5254
}
5355

56+
@Override
57+
public Set<MethodMetadata> getDeclaredMethods() {
58+
return null;
59+
}
60+
5461
}, parserContext.getRegistry());
5562
return null;
5663
}

spring-integration-file/src/test/kotlin/org/springframework/integration/kotlin/file/aggregator/KotlinFileAggregatorTests.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2021 the original author or authors.
2+
* Copyright 2021-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -84,7 +84,7 @@ class KotlinFileAggregatorTests {
8484
this.fileSplitterAggregatorFlow.send(GenericMessage(file))
8585
val receive = this.resultChannel.receive(10000)
8686
assertThat(receive).isNotNull()
87-
assertThat(receive.headers)
87+
assertThat(receive!!.headers)
8888
.all {
8989
contains(FileHeaders.FILENAME, "foo.txt")
9090
contains(FileHeaders.LINE_COUNT, 3L)

0 commit comments

Comments
 (0)