Upgrading org.springframework.boot:spring-boot-starter-data-jpa 3 to 4
Breaking3.5.16 → 4.1.2Breaking5Security2Platform1Deprecated3New94Changed674Fixed386Other218
Fetching 22 releases from GitHub…17 / 22
BreakingUpgrade verdict
5 breaking changes and a platform requirement change and 2 security fixes.
In plain terms
- If your project uses Protobuf and gRPC, the build tool no longer sets up gRPC for you automatically. You now need to turn it on yourself.
- OpenTelemetry's ZipkinSpanExporter has been deprecated and its support will be removed in Spring Boot 4.2.
- A Jetty servlet library that Spring Boot used to pull in automatically is no longer included. If your code uses classes from it, you must add it yourself.
- Two Kotlin serialization starter packages have new names that match their modules, so old names must be replaced.
Must act Top 5 of 11 that need code or config changes
org.springframework.boot:spring-boot-starter-data-jpa publishes an official migration guide for version 4. It covers more than the release notes do.
A migration guide ↗Adds org.springframework.boot:spring-boot-data-jpa 4.1.2, org.springframework.boot:spring-boot-jdbc 4.1.2.
Drops org.hibernate.orm:hibernate-core, org.springframework.data:spring-data-jpa, org.springframework:spring-aspects.
Installs 53 packages in all (was 46).
What you must change
Breaking5
Spring Boot's Gradle plugin no longer automatically configures gRPC when the Protobuf plugin is applied.
protobufgrpcprotoc-gen-grpc-javaOpenTelemetry's ZipkinSpanExporter has been deprecated and its support will be removed in Spring Boot 4.2.
Removes the unused dependency on org.eclipse.jetty.ee11:jetty-ee11-servlets from spring-boot-jetty.
org.eclipse.jetty.ee11:jetty-ee11-servletsspring-boot-jettyRenames spring-boot-starter-kotlin-serialization to spring-boot-starter-kotlinx-serialization-json and its test starter to spring-boot-starter-kotlinx-serialization-json-test.
spring-boot-starter-kotlin-serializationspring-boot-starter-kotlinx-serialization-jsonspring-boot-starter-kotlin-serialization-testspring-boot-starter-kotlinx-serialization-json-testUsing TestRestTemplate now requires a dependency on spring-boot-restclient.
TestRestTemplatespring-boot-restclientSecurity2
Applies HTML escaping to the timestamp attribute in the Whitelabel error page.
Applies HTML escaping to the timestamp attribute in the Whitelabel error page.
Platform1
Upgrade to jOOQ 3.20 and require Java 21 to use it.
Deprecations to plan for
Deprecated3
Deprecates SpringJtaPlatform, which should have been deprecated since 4.1.0-M3.
SpringJtaPlatformDeprecates OpenTelemetry's ZipkinSpanExporter, with support to be removed in Spring Boot 4.2.
ZipkinSpanExporterDelays removal of Jackson 2 support until 4.3 at the earliest.