Skip to content

fix(deps): bump spring boot and spring cloud version up #921

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 18, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ dependencies {
}
```

With gradle 9 it will be mandatory to define a launcher to run your tests with gradle. SDA Spring Boot Commons uses junit. That's why it is recommended adding the following dependency to your defined dependencies:
```
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
```

Artifacts of SDA Spring Boot Commons are available [at Maven Central](https://search.maven.org/search?q=g:org.sdase.commons.spring.boot)
since release [0.11.2](https://github.com/SDA-SE/sda-spring-boot-commons/releases/tag/0.11.2).

Expand Down
20 changes: 20 additions & 0 deletions docs/migration-4-to-5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Migration Guide for Upgrading from 4.x.x to 5.x.x

SDA Spring Boot Commons 5 updates

- Spring Boot from 3.4.x to 3.5.x and
- Spring Cloud from 2024.x.x to 2025.x.x.

This comes with some breaking changes introduced by Spring and some possible ones from SDA Spring Boot Commons as
well.
Other libraries are upgraded or replaced as well.

In addition to this migration guide, the [official release notes of Spring Boot](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.5-Release-Notes)
and [Spring Cloud](https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2025.0-Release-Notes) should be consulted.

Summary of noticeable changes:

- It can happen that a misalignment occurs between the version of the junit-platform-launcher found by gradle and the version of the junit-jupiter-engine provided in the spring dependencies. In this case, gradle is not able to run the tests and throws an error. It's necessary to add testRuntimeOnly 'org.junit.platform:junit-platform-launcher' as a dependency in your build.gradle file then. That takes the version for the junit-platform-launcher from the dependency management. In general, it should be considered to add this dependency in your build.gradle file. With gradle 9 this dependency will be [mandatory](github.com/gradle/gradle/issues/26114).
- The provided and deprecated feign.jaxrs.JakartaContract got removed from the sda-commons-starter-web package.
- The provided and deprecated kafkaDltTemplate Bean got removed from the sda-commons-starter-kafka package.
- The Spring TestRestTemplate now uses the same redirect rules as the regular RestTemplate. Additionally, the HttpOption.ENABLE_REDIRECTS option has been deprecated.
5 changes: 4 additions & 1 deletion mkdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ site_name: sda-spring-boot-commons

nav:
- Overview: index.md
- Migrate to v3: migration-2-to-3.md
- Starter Web: starter-web.md
- Starter MongoDB: starter-mongodb.md
- Starter Kafka: starter-kafka.md
Expand All @@ -20,6 +19,10 @@ nav:
- Cloud Events: cloudevents.md
- Metadata Context: metadata-context.md
- Testing: web-testing.md
- Migration:
- Migrate to v3: migration-2-to-3.md
- Migrate to v4: migration-3-to-4.md
- Migrate to v5: migration-4-to-5.md

# Always include the techdocs-core plugin, otherwise it's not possible to
# display the documentation in Backstage. We don't support other plugins
Expand Down
1 change: 1 addition & 0 deletions sda-commons-asyncapi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ dependencies {
api 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'

testImplementation project (':sda-commons-web-testing')
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
1 change: 1 addition & 0 deletions sda-commons-cacertificates/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ dependencies {
}
implementation 'org.yaml:snakeyaml'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
4 changes: 2 additions & 2 deletions sda-commons-dependencies/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ javaPlatform {
ext {
bouncycastleVersion = '1.81'
logbackContribVersion = '0.1.5'
springBootVersion = '3.4.5'
springCloudVersion = '2024.0.1'
springBootVersion = '3.5.0'
springCloudVersion = '2025.0.0'
scalaVersion = '2.13.16'
swaggerCoreVersion = '2.2.33'
victoolsVersion = '4.38.0'
Expand Down
1 change: 1 addition & 0 deletions sda-commons-dependency-check/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies {
api project(":sda-commons-web-testing")

testImplementation "io.github.classgraph:classgraph"
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,4 @@ public SdaKafkaProducerConfiguration(ObjectMapper objectMapper) {

return new KafkaTemplate<>(producerFactoryByte, props);
}

/**
* Keep Bean to not introduce breaking changes superseded by kafkaByteArrayDltTemplate should be
* removed with next major update
*
* @deprecated (uses default producerFactory which can have side effects on other templates)
*/
@Deprecated(since = "4.1.0", forRemoval = true)
@Bean
@SuppressWarnings("java:S1452")
public KafkaTemplate<Object, Object> kafkaDltTemplate(
ProducerFactory<Object, Object> producerFactory) {
Map<String, Object> props = new HashMap<>(commonProperties);
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class);
return new KafkaTemplate<>(producerFactory, props);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ class KafkaHealthIndicatorIntegrationTest {

@Autowired private TestRestTemplate client;

@SpyBean private KafkaHealthIndicator kafkaHealthIndicator;
@SuppressWarnings("removal")
// The MockitoSpyBean that should replace the SpyBean doesn't work exactly the same. See
// https://github.com/spring-projects/spring-framework/issues/33934.
// It has to be further investigated, what steps are necessary to remove this deprecated
// reference.
@SpyBean
private KafkaHealthIndicator kafkaHealthIndicator;

@Autowired private KafkaListenerEndpointRegistry kafkaListenerEndpointRegistry;

Expand Down
1 change: 1 addition & 0 deletions sda-commons-starter-mongodb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ dependencies {
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation project(":sda-commons-web-testing")
testImplementation project(":sda-commons-metadata-context")
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void initIndicesAfterStartup() {
.resolveIndexFor(it.getType())
.forEach(
indexDefinition -> {
indexOps.ensureIndex(indexDefinition);
indexOps.createIndex(indexDefinition);
LOG.info("Ensured index '{}'", indexDefinition.getIndexOptions());
});
});
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ public OpaRestTemplateConfiguration(

@Bean("opaRestTemplate")
public RestTemplate opaRestTemplate(RestTemplateBuilder builder) {
return builder.setConnectTimeout(connectionTimeout).setReadTimeout(timeout).build();
return builder.connectTimeout(connectionTimeout).readTimeout(timeout).build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public ResponseEntity<ApiError> validationErrorJakartaAnnotation(

// If MessageSourceResolvable is instance of FieldError, then add additional information.
List<ApiInvalidParam> invalidParams =
ex.getAllValidationResults().stream()
ex.getParameterValidationResults().stream()
.flatMap(
parameterValidationResult ->
parameterValidationResult.getResolvableErrors().stream())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import static jakarta.ws.rs.core.MediaType.TEXT_PLAIN;

import feign.jaxrs.JakartaContract;
import feign.jaxrs3.JAXRS3Contract;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
Expand All @@ -18,7 +18,7 @@
@FeignClient(
value = "testClient",
url = "${test.tracing.client.base.url}",
configuration = JakartaContract.class)
configuration = JAXRS3Contract.class)
public interface TracedFeignClient {

@GET
Expand Down
Loading