Skip to content

Upgrading org.springframework.boot:spring-boot-starter-test 3 to 4

Breaking3.5.16 → 4.1.2Breaking7Security2Platform1Deprecated8New313Changed937Fixed466Other272

BreakingUpgrade verdict

7 breaking changes and a platform requirement change and 2 security fixes.

  • If your project uses Protobuf and gRPC with Gradle, the gRPC setup is no longer applied automatically. You must opt in explicitly.
  • A library that Spring Boot's Jetty support used to pull in automatically is no longer included. If your own code uses classes from it, you must add it yourself.
  • Removes support for the deprecated layertools jar mode.
  • Removes support for deprecated Logback properties.
Top 5 of 18 that need code or config changes

org.springframework.boot:spring-boot-starter-test publishes an official migration guide for version 4. It covers more than the release notes do.

A migration guide ↗

Installs 49 packages in all (was 48).

Breaking7
Spring Boot's Gradle plugin no longer automatically configures gRPC when the Protobuf plugin is applied.
protobufgrpcprotoc-gen-grpc-java
Removes the unused dependency on org.eclipse.jetty.ee11:jetty-ee11-servlets from spring-boot-jetty.
spring-boot-jettyorg.eclipse.jetty.ee11:jetty-ee11-servlets
Removes support for the deprecated layertools jar mode.
layertools
Removes support for deprecated Logback properties.
Logback
Removes the unused dependency on org.eclipse.jetty.ee11:jetty-ee11-servlets from spring-boot-jetty.
org.eclipse.jetty.ee11:jetty-ee11-servletsspring-boot-jetty
Renames 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-test
Using TestRestTemplate now requires a dependency on spring-boot-restclient.
TestRestTemplatespring-boot-restclient
Security2
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
Upgrades to jOOQ 3.20 and requires Java 21 to use it.
jOOQ
Deprecated8
SpringJtaPlatform is now deprecated as of 4.1.0-M3.
SpringJtaPlatform
Deprecates OpenTelemetry's ZipkinSpanExporter, with support to be removed in Spring Boot 4.2.
ZipkinSpanExporter
Deprecates LiveReload support for removal.
Deprecates RootUriTemplateHandler in favor of DefaultUriBuilderFactory.
RootUriTemplateHandlerDefaultUriBuilderFactory
Delays removal of Jackson 2 support until 4.3 at the earliest.
Deprecates Derby support since Apache Derby is retired.
Derby
Deprecates OpenTelemetry's ZipkinSpanExporter, with support to be removed in Spring Boot 4.2.
ZipkinSpanExporter
Delays removal of Jackson 2 support until 4.3 at the earliest.