Skip to content

Conversation

@meysholdt
Copy link
Contributor

Spring Boot Migration Report

Version Summary

Component Original Version Target Version
Spring Boot 3.5.0 4.0.0
Java 17 21

Summary of Code Changes

Build Configuration Changes

  • Updated Spring Boot parent version from 3.5.0 to 4.0.0
  • Updated Java version from 17 to 21
  • Updated spring-javaformat plugin from 0.0.46 to 0.0.47
  • Updated Native build tools plugin from 0.10.6 to 0.11.0
  • Updated CycloneDX plugin from 2.3.1 to 3.0.0
  • Renamed spring-boot-starter-web to spring-boot-starter-webmvc
  • Added explicit testcontainers version 1.21.3
  • Added new test dependencies: spring-boot-webmvc-test, spring-boot-data-jpa-test, spring-boot-restclient-test

Package Reorganization

Spring Boot 4.0 reorganized packages as part of modularization:

Old Package New Package
o.s.b.autoconfigure.cache.JCacheManagerCustomizer o.s.b.cache.autoconfigure.JCacheManagerCustomizer
o.s.b.test.autoconfigure.web.servlet.WebMvcTest o.s.b.webmvc.test.autoconfigure.WebMvcTest
o.s.b.test.autoconfigure.orm.jpa.DataJpaTest o.s.b.data.jpa.test.autoconfigure.DataJpaTest
o.s.b.test.autoconfigure.jdbc.AutoConfigureTestDatabase o.s.b.jdbc.test.autoconfigure.AutoConfigureTestDatabase
o.s.b.autoconfigure.jdbc.DataSourceAutoConfiguration o.s.b.jdbc.autoconfigure.DataSourceAutoConfiguration
o.s.b.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration o.s.b.hibernate.autoconfigure.HibernateJpaAutoConfiguration

API Changes

  • Replaced RestTemplateBuilder and TestRestTemplate with RestClient in test code
  • Updated test assertions in CrashControllerIntegrationTests for error handling changes

Verification Steps Executed

Step Command Result
Compile main code ./mvnw compile ✅ SUCCESS
Compile test code ./mvnw test-compile ✅ SUCCESS
Run all tests ./mvnw test ✅ 58 tests passed
Package application ./mvnw package ✅ SUCCESS
Start application java -jar target/spring-petclinic-4.0.0-SNAPSHOT.jar ✅ Running
Health check curl http://localhost:8080/actuator/health {"status":"UP"}

- Update Spring Boot parent version from 3.5.0 to 4.0.0
- Update Java version from 17 to 21
- Rename spring-boot-starter-web to spring-boot-starter-webmvc
- Update package imports for Spring Boot 4.0 modularization
- Replace RestTemplateBuilder/TestRestTemplate with RestClient
- Add new test dependencies for modular test slices
- Update plugin versions for compatibility

Co-authored-by: Ona <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants