Skip to content

Commit 5161e0c

Browse files
authored
Upgrade to Spring Boot 4 and Spring Framework 7 (#4133)
Changes done: * Use Jackson2 for our own DispatcherServlet until we fully migrate to Jackson 3 * Test servers are not pausable * Add certain Spring Boot specific dependencies (e.g. spring-boot-kafka, spring-boot-restclient, etc.). They are needed since Spring Boot 4 changed how their modules look like and the auto configurations are no longer in one single jar. Now there are JARs based on the integration. * Rewrite the Spring Kafka retry mechanism since it got migrated from Spring Retry to the Spring Core retry. Remove uniform random backoff. The reason for this is the fact that Spring Kafka itself no longer supports it. Remove exponential random backoff. This would be replaced with a jitter, this is a plus / minus value with some randomness that gets applied to the delay. * Replace deprecated Spring Security AntPathRequestMatcher with the new PathPatternRequestMatcher Upgraded versions: * Apache Http Client 5 - 5.5.1 * Jakarta Enterprise CDI - 4.1.0 * Jakarta Enterprise Concurrent - 3.1.1 * Jakarta Persistence - 3.2.0 * Jakarta Servlet - 6.1.0 * Jetty - 12.1.3 * HikariCP - 7.0.2 * Reactor Netty - 1.3.0-RC1 * Spring AMQP - 4.0.0-RC1 * Spring Boot - 4.0.0-RC1 * Spring Kafka - 4.0.0-RC1 * Spring LDAP - 4.0.0-RC1 * Spring Framework - 7.0.0-RC2 * Spring Security - 7.0.0-RC1 Upgraded JDBC Drivers: * DB2 - 12.1.2.0 * HSQL - 2.7.3 * MariaDB - 3.5.6 * MS SQL - 13.2.1.jre11 * Oracle - 23.9.0.25.07 * Postgres - 42.7.8 Upgraded Test Dependencies: * AssertJ - 3.27.6 * JsonUnit - 5.0.0 * JUnit Jupiter - 6.0.0 * Mockito - 5.20.0 * Testcontainers - 2.0.1 Upgraded Maven Plugins: * Maven Surefire - 3.5.4 * Liquibase - 4.33.0
1 parent 7fcb568 commit 5161e0c

File tree

86 files changed

+346
-519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+346
-519
lines changed

modules/flowable-app-engine-rest/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
<properties>
1919
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20-
<jetty.version>12.0.15</jetty.version>
20+
<jetty.version>12.1.3</jetty.version>
2121
<flowable.artifact>
2222
org.flowable.app.rest
2323
</flowable.artifact>

modules/flowable-app-engine-rest/src/test/java/org/flowable/app/rest/DispatcherServletConfiguration.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@
1212
*/
1313
package org.flowable.app.rest;
1414

15-
import java.util.List;
16-
1715
import org.springframework.beans.factory.annotation.Autowired;
1816
import org.springframework.context.annotation.Bean;
1917
import org.springframework.context.annotation.ComponentScan;
2018
import org.springframework.context.annotation.Configuration;
21-
import org.springframework.http.converter.HttpMessageConverter;
19+
import org.springframework.http.converter.HttpMessageConverters;
2220
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
2321
import org.springframework.web.multipart.MultipartResolver;
2422
import org.springframework.web.multipart.support.StandardServletMultipartResolver;
@@ -39,15 +37,8 @@ public MultipartResolver multipartResolver() {
3937
}
4038

4139
@Override
42-
public void configureMessageConverters(List<HttpMessageConverter<?>> converters) {
43-
addDefaultHttpMessageConverters(converters);
44-
for (HttpMessageConverter<?> converter : converters) {
45-
if (converter instanceof MappingJackson2HttpMessageConverter) {
46-
MappingJackson2HttpMessageConverter jackson2HttpMessageConverter = (MappingJackson2HttpMessageConverter) converter;
47-
jackson2HttpMessageConverter.setObjectMapper(objectMapper);
48-
break;
49-
}
50-
}
40+
protected void configureMessageConverters(HttpMessageConverters.ServerBuilder builder) {
41+
builder.jsonMessageConverter(new MappingJackson2HttpMessageConverter(objectMapper));
5142
}
5243

5344
}

modules/flowable-app-engine-rest/src/test/java/org/flowable/app/rest/util/TestServer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ public boolean isRunning() {
7979
return running;
8080
}
8181

82+
@Override
83+
public boolean isPauseable() {
84+
return false;
85+
}
86+
8287
public String getServerUrlPrefix() {
8388
return "http://localhost:" + server.getURI().getPort() + "/service/";
8489
}

modules/flowable-app-rest/pom.xml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,8 +752,8 @@
752752
</dependency>
753753

754754
<dependency>
755-
<groupId>org.springframework.kafka</groupId>
756-
<artifactId>spring-kafka</artifactId>
755+
<groupId>org.springframework.boot</groupId>
756+
<artifactId>spring-boot-kafka</artifactId>
757757
</dependency>
758758

759759
<dependency>
@@ -778,6 +778,11 @@
778778
<scope>test</scope>
779779
</dependency>
780780
<!-- LDAP dependencies needed for testing purposes -->
781+
<dependency>
782+
<groupId>org.springframework.boot</groupId>
783+
<artifactId>spring-boot-ldap</artifactId>
784+
<scope>test</scope>
785+
</dependency>
781786
<dependency>
782787
<groupId>org.springframework.ldap</groupId>
783788
<artifactId>spring-ldap-core</artifactId>
@@ -793,5 +798,16 @@
793798
<artifactId>json-unit-assertj</artifactId>
794799
<scope>test</scope>
795800
</dependency>
801+
<dependency>
802+
<groupId>org.springframework.boot</groupId>
803+
<artifactId>spring-boot-resttestclient</artifactId>
804+
<scope>test</scope>
805+
</dependency>
806+
<dependency>
807+
<groupId>org.springframework.boot</groupId>
808+
<artifactId>spring-boot-starter-actuator-test</artifactId>
809+
<scope>test</scope>
810+
</dependency>
811+
796812
</dependencies>
797813
</project>

modules/flowable-app-rest/src/main/java/org/flowable/rest/app/FlowableRestAppEventRegistryCondition.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@ protected Map<String, ConditionOutcome> getConditionOutcomes() {
6868
Map<String, ConditionOutcome> conditions = new HashMap<>();
6969

7070
if (!jmsEnabled) {
71-
conditions.put("org.springframework.boot.autoconfigure.jms.artemis.ArtemisAutoConfiguration",
71+
conditions.put("org.springframework.boot.artemis.autoconfigure.ArtemisAutoConfiguration",
7272
ConditionOutcome.noMatch("Property flowable.task.app.jms-enabled was not set to true")
7373
);
7474
}
7575

7676
if (!kafkaEnabled) {
77-
conditions.put("org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration",
77+
conditions.put("org.springframework.boot.kafka.autoconfigure.KafkaAutoConfiguration",
7878
ConditionOutcome.noMatch("Property flowable.task.app.kafka-enabled was not set to true")
7979
);
8080
}
8181

8282
if (!rabbitEnabled) {
83-
conditions.put("org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration",
83+
conditions.put("org.springframework.boot.amqp.autoconfigure.RabbitAutoConfiguration",
8484
ConditionOutcome.noMatch("Property flowable.task.app.rabbit-enabled was not set to true")
8585
);
8686
}

modules/flowable-app-rest/src/main/java/org/flowable/rest/app/properties/BackwardsCompatiblePropertiesLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
import org.slf4j.Logger;
2121
import org.slf4j.LoggerFactory;
22+
import org.springframework.boot.EnvironmentPostProcessor;
2223
import org.springframework.boot.SpringApplication;
2324
import org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor;
24-
import org.springframework.boot.env.EnvironmentPostProcessor;
2525
import org.springframework.core.Ordered;
2626
import org.springframework.core.env.ConfigurableEnvironment;
2727
import org.springframework.core.env.MutablePropertySources;

modules/flowable-app-rest/src/main/java/org/flowable/rest/conf/PropertyBasedCorsFilter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public PropertyBasedCorsFilter(RestAppProperties restAppProperties) {
3434
}
3535

3636
@Override
37-
public void configure(HttpSecurity http) throws Exception {
37+
public void configure(HttpSecurity http) {
3838
CorsFilter corsFilter = corsFilter(restAppProperties.getCors());
3939
http.addFilterBefore(corsFilter, UsernamePasswordAuthenticationFilter.class);
4040
}

modules/flowable-app-rest/src/main/java/org/flowable/rest/conf/SecurityConfiguration.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
import org.flowable.rest.app.properties.RestAppProperties;
1717
import org.flowable.rest.security.BasicAuthenticationProvider;
1818
import org.flowable.rest.security.SecurityConstants;
19-
import org.springframework.boot.actuate.autoconfigure.security.servlet.EndpointRequest;
20-
import org.springframework.boot.actuate.health.HealthEndpoint;
2119
import org.springframework.boot.actuate.info.InfoEndpoint;
20+
import org.springframework.boot.health.actuate.endpoint.HealthEndpoint;
21+
import org.springframework.boot.security.autoconfigure.actuate.web.servlet.EndpointRequest;
2222
import org.springframework.context.annotation.Bean;
2323
import org.springframework.context.annotation.Configuration;
2424
import org.springframework.security.authentication.AuthenticationProvider;

modules/flowable-app-rest/src/main/resources/META-INF/spring.factories

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
org.springframework.boot.env.EnvironmentPostProcessor=\
1+
org.springframework.boot.EnvironmentPostProcessor=\
22
org.flowable.rest.app.properties.BackwardsCompatiblePropertiesLoader
33

44
# Auto Configuration Import Filters

modules/flowable-app-rest/src/test/java/org/flowable/rest/app/FlowableRestApplicationLdapAuthenticationTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@
1616

1717
import org.junit.jupiter.api.Test;
1818
import org.springframework.beans.factory.annotation.Autowired;
19+
import org.springframework.boot.resttestclient.TestRestTemplate;
20+
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureTestRestTemplate;
1921
import org.springframework.boot.test.context.SpringBootTest;
20-
import org.springframework.boot.test.web.client.TestRestTemplate;
2122
import org.springframework.http.HttpStatus;
2223
import org.springframework.http.ResponseEntity;
2324
import org.springframework.test.context.ActiveProfiles;
@@ -27,6 +28,7 @@
2728
*/
2829
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
2930
@ActiveProfiles("test-ldap")
31+
@AutoConfigureTestRestTemplate
3032
public class FlowableRestApplicationLdapAuthenticationTest {
3133

3234
@Autowired

0 commit comments

Comments
 (0)