Upgrade dependencies; prepare for release

* Upgrade to Gradle `7.3.3`
* Upgrade to the latest milestones for releasing
* Upgrade to Kryo-5.2.1 and update source code according breaking changes
* Upgrade to H2-2.1.210 and re-enable respective stored procedure tests
This commit is contained in:
Artem Bilan
2022-01-18 17:14:33 -05:00
parent c28e251091
commit d6bf681aa4
12 changed files with 94 additions and 82 deletions

View File

@@ -15,9 +15,9 @@ buildscript {
plugins {
id 'org.sonarqube' version '2.8'
id 'io.spring.nohttp' version '0.0.10' apply false
id 'org.ajoberstar.grgit' version '4.1.0'
id 'org.ajoberstar.grgit' version '4.1.1'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'com.jfrog.artifactory' version '4.24.20' apply false
id 'com.jfrog.artifactory' version '4.26.1' apply false
id 'org.jetbrains.dokka' version '1.6.10'
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
id 'org.asciidoctor.jvm.gems' version '3.3.2'
@@ -48,64 +48,64 @@ ext {
files(grgit.status().unstaged.modified).filter { f -> f.name.endsWith('.java') || f.name.endsWith('.kt') }
apacheSshdVersion = '2.8.0'
artemisVersion = '2.19.0'
aspectjVersion = '1.9.7'
assertjVersion = '3.21.0'
artemisVersion = '2.20.0'
aspectjVersion = '1.9.8.RC3'
assertjVersion = '3.22.0'
assertkVersion = '0.25'
avroVersion = '1.10.2'
avroVersion = '1.11.0'
awaitilityVersion = '4.1.1'
commonsDbcp2Version = '2.9.0'
commonsIoVersion = '2.11.0'
commonsNetVersion = '3.8.0'
curatorVersion = '4.3.0'
derbyVersion = '10.14.2.0'
ftpServerVersion = '1.1.1'
ftpServerVersion = '1.1.2'
googleJsr305Version = '3.0.2'
greenmailVersion = '2.0.0-alpha-2'
groovyVersion = '3.0.9'
hamcrestVersion = '2.2'
hazelcastVersion = '5.0.2'
hibernateVersion = '5.6.1.Final'
hsqldbVersion = '2.6.0'
h2Version = '2.0.206'
jacksonVersion = '2.13.0'
hibernateVersion = '5.6.3.Final'
hsqldbVersion = '2.6.1'
h2Version = '2.1.210'
jacksonVersion = '2.13.1'
jaxbVersion = '3.0.2'
jeroMqVersion = '0.5.2'
jmsApiVersion = '3.0.0'
jpaApiVersion = '3.0.2'
jrubyVersion = '9.2.19.0'
jrubyVersion = '9.3.2.0'
jschVersion = '0.1.55'
jsonpathVersion = '2.6.0'
junit4Version = '4.13.2'
junitJupiterVersion = '5.8.1'
junitJupiterVersion = '5.8.2'
jythonVersion = '2.7.2'
kryoShadedVersion = '4.0.2'
lettuceVersion = '6.1.5.RELEASE'
log4jVersion = '2.17.0'
kryoVersion = '5.2.1'
lettuceVersion = '6.1.6.RELEASE'
log4jVersion = '2.17.1'
mailVersion = '2.0.1'
micrometerVersion = '1.7.7'
mockitoVersion = '4.0.0'
mongoDriverVersion = '4.4.0'
mysqlVersion = '8.0.27'
micrometerVersion = '2.0.0-M1'
mockitoVersion = '4.2.0'
mongoDriverVersion = '4.4.1'
mysqlVersion = '8.0.28'
pahoMqttClientVersion = '1.2.5'
postgresVersion = '42.2.23'
r2dbch2Version = '0.9.0.M1'
reactorVersion = '2020.0.14'
postgresVersion = '42.3.1'
r2dbch2Version = '0.9.0.RELEASE'
reactorVersion = '2020.0.15'
resilience4jVersion = '1.7.1'
romeToolsVersion = '1.16.0'
romeToolsVersion = '1.18.0'
rsocketVersion = '1.1.1'
saajVersion = '2.0.1'
servletApiVersion = '5.0.0'
smackVersion = '4.3.5'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '3.0.0-SNAPSHOT'
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : '2022.1.0-SNAPSHOT'
springKafkaVersion = '3.0.0-SNAPSHOT'
springAmqpVersion = project.hasProperty('springAmqpVersion') ? project.springAmqpVersion : '3.0.0-M1'
springDataVersion = project.hasProperty('springDataVersion') ? project.springDataVersion : '2022.0.0-M1'
springKafkaVersion = '3.0.0-M1'
springRetryVersion = '1.3.1'
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '6.0.0-SNAPSHOT'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '6.0.0-SNAPSHOT'
springWsVersion = '4.0.0-SNAPSHOT'
springSecurityVersion = project.hasProperty('springSecurityVersion') ? project.springSecurityVersion : '6.0.0-M1'
springVersion = project.hasProperty('springVersion') ? project.springVersion : '6.0.0-M2'
springWsVersion = '4.0.0-M1'
testcontainersVersion = '1.16.2'
tomcatVersion = '10.0.11'
tomcatVersion = '10.0.14'
xmlUnitVersion = '2.8.4'
xstreamVersion = '1.4.18'
@@ -357,7 +357,7 @@ configure(javaProjects) { subproject ->
checkstyle {
configDirectory.set(rootProject.file('src/checkstyle'))
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '9.2'
toolVersion = project.hasProperty('checkstyleVersion') ? project.checkstyleVersion : '9.2.1'
}
jar {
@@ -497,7 +497,7 @@ project('spring-integration-core') {
}
optionalApi "com.jayway.jsonpath:json-path:$jsonpathVersion"
optionalApi "com.esotericsoftware:kryo-shaded:$kryoShadedVersion"
optionalApi "com.esotericsoftware:kryo:$kryoVersion"
optionalApi "io.micrometer:micrometer-core:$micrometerVersion"
optionalApi "io.github.resilience4j:resilience4j-ratelimiter:$resilience4jVersion"
optionalApi "org.apache.avro:avro:$avroVersion"
@@ -657,7 +657,7 @@ project('spring-integration-ip') {
testImplementation project(':spring-integration-event')
testImplementation "org.hamcrest:hamcrest-core:$hamcrestVersion"
testRuntimeOnly "com.esotericsoftware:kryo-shaded:$kryoShadedVersion"
testRuntimeOnly "com.esotericsoftware:kryo:$kryoVersion"
testRuntimeOnly 'com.fasterxml.jackson.core:jackson-databind'
}

View File

@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionSha256Sum=23b89f8eac363f5f4b8336e0530c7295c55b728a9caa5268fdd4a532610d5392
distributionSha256Sum=b586e04868a22fd817c8971330fec37e298f3242eb85c374181b12d637f80302

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2020 the original author or authors.
* Copyright 2015-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,69 +27,71 @@ import org.springframework.util.Assert;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import com.esotericsoftware.kryo.pool.KryoFactory;
import com.esotericsoftware.kryo.pool.KryoPool;
import com.esotericsoftware.kryo.util.Pool;
/**
* Base class for {@link Codec}s using {@link Kryo}.
* Manages pooled {@link Kryo} instances.
*
* @author David Turanski
* @author Artem Bilan
*
* @since 4.2
*/
public abstract class AbstractKryoCodec implements Codec {
protected final KryoPool pool; // NOSONAR final
protected final Pool<Kryo> pool; // NOSONAR final
protected AbstractKryoCodec() {
KryoFactory factory = () -> {
Kryo kryo = new Kryo();
kryo.setRegistrationRequired(true);
// configure Kryo instance, customize settings
configureKryoInstance(kryo);
return kryo;
this.pool = new Pool<>(true, true) {
@Override
protected Kryo create() {
Kryo kryo = new Kryo();
kryo.setRegistrationRequired(true);
// configure Kryo instance, customize settings
configureKryoInstance(kryo);
return kryo;
}
};
// Build pool with SoftReferences enabled (optional)
this.pool = new KryoPool.Builder(factory).softReferences().build();
}
@Override
public void encode(final Object object, OutputStream outputStream) {
Assert.notNull(object, "cannot encode a null object");
Assert.notNull(outputStream, "'outputSteam' cannot be null");
final Output output = (outputStream instanceof Output ? (Output) outputStream : new Output(outputStream));
this.pool.run(kryo -> {
Kryo kryo = this.pool.obtain();
try (Output output = (outputStream instanceof Output ? (Output) outputStream : new Output(outputStream))) {
doEncode(kryo, object, output);
return Void.class;
});
output.close();
}
finally {
this.pool.free(kryo);
}
}
@Override
public <T> T decode(byte[] bytes, Class<T> type) throws IOException {
Assert.notNull(bytes, "'bytes' cannot be null");
final Input input = new Input(bytes);
try {
try (Input input = new Input(bytes)) {
return decode(input, type);
}
finally {
input.close();
}
}
@Override
public <T> T decode(InputStream inputStream, final Class<T> type) {
Assert.notNull(inputStream, "'inputStream' cannot be null");
Assert.notNull(type, "'type' cannot be null");
final Input input = (inputStream instanceof Input ? (Input) inputStream : new Input(inputStream));
T result = null;
try {
result = this.pool.run(kryo -> doDecode(kryo, input, type));
Kryo kryo = this.pool.obtain();
try (Input input = (inputStream instanceof Input ? (Input) inputStream : new Input(inputStream))) {
return doDecode(kryo, input, type);
}
finally {
input.close();
this.pool.free(kryo);
}
return result;
}
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2020 the original author or authors.
* Copyright 2015-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -34,6 +34,10 @@ public abstract class AbstractKryoRegistrar implements KryoRegistrar {
protected static final Kryo KRYO = new Kryo();
static {
KRYO.setRegistrationRequired(false);
}
protected final Log log = LogFactory.getLog(getClass()); // NOSONAR property is final
@Override

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2019 the original author or authors.
* Copyright 2015-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -30,6 +30,8 @@ import com.esotericsoftware.kryo.io.Output;
* is declared transient.
*
* @author David Turanski
* @author Artem Bilan
*
* @since 4.2
*/
public class FileSerializer extends Serializer<File> {
@@ -40,8 +42,8 @@ public class FileSerializer extends Serializer<File> {
}
@Override
public File read(Kryo kryo, Input input, Class<File> type) {
String path = input.readString();
public File read(Kryo kryo, Input input, Class<? extends File> type) {
String path = input.readString();
return new File(path);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2019 the original author or authors.
* Copyright 2015-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -28,13 +28,17 @@ import com.esotericsoftware.kryo.io.Output;
/**
* Kryo Serializer for {@link MessageHeaders}.
*
* @author David Turanski
* @author Artem Bilan
*
* @since 4.2
*/
class MessageHeadersSerializer extends Serializer<MessageHeaders> {
@Override
public void write(Kryo kryo, Output output, MessageHeaders headers) {
HashMap<String, Object> map = new HashMap<String, Object>();
HashMap<String, Object> map = new HashMap<>();
for (Map.Entry<String, Object> entry : headers.entrySet()) {
if (entry.getValue() != null) {
map.put(entry.getKey(), entry.getValue());
@@ -44,7 +48,7 @@ class MessageHeadersSerializer extends Serializer<MessageHeaders> {
}
@Override
public MessageHeaders read(Kryo kryo, Input input, Class<MessageHeaders> type) {
public MessageHeaders read(Kryo kryo, Input input, Class<? extends MessageHeaders> type) {
@SuppressWarnings("unchecked")
Map<String, Object> headers = kryo.readObject(input, HashMap.class);
return new MessageHeaders(headers);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2019 the original author or authors.
* Copyright 2015-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,13 +27,16 @@ import com.esotericsoftware.kryo.io.Input;
/**
* Kryo Serializer for {@link MutableMessageHeaders}.
*
* @author David Turanski
* @author Artem Bilan
*
* @since 4.2
*/
class MutableMessageHeadersSerializer extends MessageHeadersSerializer {
@Override
public MessageHeaders read(Kryo kryo, Input input, Class<MessageHeaders> type) {
public MessageHeaders read(Kryo kryo, Input input, Class<? extends MessageHeaders> type) {
@SuppressWarnings("unchecked")
Map<String, Object> headers = kryo.readObject(input, HashMap.class);
return new MutableMessageHeaders(headers);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2015-2019 the original author or authors.
* Copyright 2015-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ import org.springframework.util.CollectionUtils;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import com.esotericsoftware.kryo.util.DefaultInstantiatorStrategy;
/**
* Kryo Codec that can encode and decode arbitrary types. Classes and associated
@@ -34,6 +35,7 @@ import com.esotericsoftware.kryo.io.Output;
*
* @author David Turanski
* @author Artem Bilan
*
* @since 4.2
*/
public class PojoCodec extends AbstractKryoCodec {
@@ -99,7 +101,7 @@ public class PojoCodec extends AbstractKryoCodec {
@Override
protected void configureKryoInstance(Kryo kryo) {
kryo.setInstantiatorStrategy(new Kryo.DefaultInstantiatorStrategy(new StdInstantiatorStrategy()));
kryo.setInstantiatorStrategy(new DefaultInstantiatorStrategy(new StdInstantiatorStrategy()));
if (this.kryoRegistrar != null) {
this.kryoRegistrar.registerTypes(kryo);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2019 the original author or authors.
* Copyright 2002-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -117,6 +117,7 @@ public class CookieTests {
}
@Override
@Deprecated
public String getMethodValue() {
return null;
}

View File

@@ -26,7 +26,6 @@ import java.util.List;
import javax.sql.DataSource;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -62,7 +61,6 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
*/
@SpringJUnitConfig
@DirtiesContext
@Disabled("H2 v2 is broken for stored procedures")
public class StoredProcJavaConfigTests {
@Autowired

View File

@@ -26,7 +26,6 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -43,7 +42,6 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
*/
@SpringJUnitConfig
@DirtiesContext
@Disabled("H2 v2 is broken for stored procedures")
public class StoredProcPollingChannelAdapterWithNamespaceIntegrationTests {
@Autowired

View File

@@ -26,7 +26,6 @@ import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
@@ -42,7 +41,6 @@ import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
*/
@SpringJUnitConfig
@DirtiesContext
@Disabled("H2 v2 is broken for stored procedures")
public class StoredProcPollingChannelAdapterWithSpringContextIntegrationTests {
@Autowired