Spring Boot 4.2 Release: What Changes for You (November 2026)
- #Java
- #Spring Boot
- #upgrades
- #releases
Spring Boot 4.2.0 came out on November 19, 2026. It's the November feature
release, the second one since the 4.0 generation change a year ago, and it
sits on Spring Framework 7.1.0. It isn't a 3-to-4 style rewrite. Still, this
Spring Boot release does more than you'd guess from the version number: it
deprecates RestTemplate for removal, renames a starter you might be using,
changes the base image your containers are built on, and flips a few defaults
that only show up when traffic goes through a proxy.
This post covers what's in 4.2, what actually breaks when you bump the version, which Java you need, and the upgrade path from the versions most teams are running today. Every fact here comes from the official release notes, the 4.2 docs and the support table (sources at the end). The code samples were compiled and run against 4.2.0 on Corretto 25 before I put them here.
Spring Boot 4.2 at a glance
- Version and date: 4.2.0, GA on November 19, 2026, from Maven Central.
- Built on: Spring Framework 7.1.0, Spring Security 7.2.0, Spring Data 2026.1.0, Micrometer 1.18.0.
- Java: at least Java 17, compatible up to and including Java 27.
- Build tools: Maven 3.6.3 or later; Gradle 8.14+ or 9.x.
- Servlet containers: Tomcat 11.0.x and Jetty 12.1.x (Servlet 6.1).
- Native images: GraalVM 25 or later.
- Open source support: until December 31, 2027. Commercial support runs to December 31, 2028.
If you take one thing from this list: Spring Boot 4.0's open source support ends on December 31, 2026, five weeks from today. If you're on 4.0, this release is your signal to start moving, not something to bookmark for later.
Which Java does Spring Boot 4.2 need?
The baseline hasn't moved: Java 17 is still the minimum, as it has been since Boot 3.0. What changed is the top end. Spring Boot 4.2 is compatible with Java 27, the non-LTS release that shipped in September (I covered what's in it in Java 27: What's New). Spring Boot 4.1 went up to Java 26, and 4.0 up to 25.
Compatible with 27 doesn't mean you should run 27 in production. For most services the sensible pick is still Java 25, the current LTS, and Which Java Version Should You Run in 2027? explains why. What 4.2 gives you is the option to run your test suite on 27 in CI without having to guess whether the framework is the problem when something fails.
If you build with Gradle, check your wrapper: 4.2 wants 8.14 or newer on the 8.x line.
What's new for application developers
Most of the release notes are about specific integrations. These are the parts that reach a typical web or messaging service:
AMQP 1.0 support. There's now a generic AMQP 1.0 client, plus a variant built for RabbitMQ. This is also the source of the biggest upgrade trap, covered below, because the existing AMQP 0.9 support had to move to make room.
OpenTelemetry semantic conventions, opt-in. Set
management.observations.conventions=open-telemetry and Boot uses
OpenTelemetry's stable conventions for observation names and tags instead of
Micrometer's defaults. If your dashboards are built on the old names, leave it
off until you're ready to migrate them. There are also shared OTLP properties
(management.opentelemetry.otlp.endpoint, .headers, .compression) so you
stop repeating the same endpoint for traces, metrics and logs, and you can now
rename the MDC keys for trace and span IDs
(management.tracing.mdc.trace-id-key, management.tracing.mdc.span-id-key).
That last one is handy if your log pipeline already expects trace_id.
Faster executable jar startup. No configuration, it's just faster. The announcement doesn't put a number on it, and I won't either.
Buildpacks on Ubuntu 26.04. Images built with spring-boot:build-image
or bootBuildImage now default to an Ubuntu 26.04 base, and the build cache
can live in a registry instead of on the build machine. That's useful on CI
runners that start from scratch every time.
Smaller conveniences. @DefaultValue on constructor-bound configuration
properties accepts property placeholders now. The
spring-boot-properties-migrator can be told to fail the application on
errors or warnings, which makes it far more useful in CI (more on that in the
upgrade section). GraphQL gets spring.graphql.http.methods to control which
HTTP methods the endpoint accepts (POST only by default), and Kafka can use a
dedicated KafkaAdmin for templates and listeners.
RestTemplate is now deprecated for removal
This is the change that will touch the most code. Spring Framework 7.1
deprecates RestTemplate for removal, and Spring Boot 4.2 deprecates its
support around it: RestTemplateBuilder, RestTemplateCustomizer,
TestRestTemplate, the MockRestServiceServer auto-configuration and the
rest of that family. The replacements are RestClient for production code and
RestTestClient for tests.
Nothing stops working today. But a deprecation "for removal" means a future
major version will take it away, and the compiler is going to remind you on
every build. When I compiled a class that injects RestTemplateBuilder
against 4.2.0, both types came back flagged as "deprecated and marked for
removal".
The migration is usually mechanical. Here's a client written with
RestClient, the way Boot wants it now. Inject the auto-configured
RestClient.Builder rather than calling RestClient.create(), so you keep
Boot's message converters, observability and customizers:
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestClient;
@Component
class QuoteClient {
private final RestClient restClient;
QuoteClient(RestClient.Builder builder, @Value("${quotes.base-url}") String baseUrl) {
this.restClient = builder.baseUrl(baseUrl).build();
}
Quote fetch(long id) {
return restClient.get()
.uri("/quotes/{id}", id)
.retrieve()
.body(Quote.class);
}
}
The RestTemplateBuilder version would have been
builder.rootUri(baseUrl).build() plus getForObject("/quotes/{id}", Quote.class, id).
Same idea, with a fluent API that makes the request and the error handling
explicit. With Boot 4's modular starters, RestClient.Builder comes from
spring-boot-starter-restclient.
For tests, swap TestRestTemplate for RestTestClient and the
@AutoConfigureRestTestClient annotation (from the spring-boot-resttestclient
module):
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.resttestclient.autoconfigure.AutoConfigureRestTestClient;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.web.servlet.client.RestTestClient;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@AutoConfigureRestTestClient
class QuoteControllerTest {
@Autowired
RestTestClient client;
@Test
void returnsAQuote() {
client.get().uri("/quotes/42")
.exchange()
.expectStatus().isOk()
.expectBody(Quote.class)
.isEqualTo(new Quote(42, "Upgrade one concern at a time."));
}
}
If you've used WebTestClient, the assertion style will look familiar.
If your test suite is mostly TestRestTemplate, this is the part of the
upgrade worth giving its own ticket.
Testing Your Spring Boot Application
covers the wider testing setup these classes fit into.
What breaks when you upgrade from 4.1
Deprecations warn you. These ones change behavior, and some of them only show up at runtime.
The AMQP starter changed meaning. The AMQP 0.9 support (what you use for
classic RabbitMQ) moved from the spring-boot-amqp module to
spring-boot-rabbitmq, and its classes moved from org.springframework.boot.amqp
to org.springframework.boot.rabbitmq. Meanwhile spring-boot-starter-amqp
now gives you generic AMQP 1.0. If you depend on spring-boot-starter-amqp
for RabbitMQ today, switch to spring-boot-starter-rabbitmq to keep the
behavior you have. Your spring.rabbitmq.* properties don't change.
Forwarded headers have new properties and a new default. Everything moved
under server.request.header.forwarded. server.forward-headers-strategy is
deprecated in favor of server.request.header.forwarded.strategy, whose values
are web-server (what used to be native), framework and none. Two
details matter here:
X-Forwarded-Prefixis now ignored by default. If you run behind a gateway or ingress that strips a path prefix and sets this header, your generated links and redirects will lose the prefix after the upgrade. Setserver.request.header.forwarded.use-prefix=trueto restore it (Tomcat and Jetty don't support that option, so use theframeworkstrategy there).- Setting the old and new property together fails startup. I checked:
with
server.forward-headers-strategy=nativeandserver.request.header.forwarded.strategy=frameworkboth set, 4.2.0 refuses to start and reports that the two properties are mutually exclusive. Good behavior, but watch for it if your properties come from several places (a baseapplication.ymlplus environment variables in Kubernetes, say).
Tomcat now sends relative redirects.
server.tomcat.servlet.use-relative-redirects defaults to true. That's
usually what you want behind a proxy, but if something downstream expects an
absolute Location header, set it to false. The related Tomcat properties
also moved under server.tomcat.servlet.*.
Container images change base and lose the shell. The default builder is
now paketobuildpacks/ubuntu-resolute-builder (Ubuntu 26.04), and when you
don't set a builder, the run image is a tiny one without a shell. If your
Kubernetes probes or debugging habits rely on kubectl exec ... sh, that
stops working. There's also a known incompatibility with Paketo's Spring
Cloud Bindings: startup fails looking for
org.springframework.boot.env.EnvironmentPostProcessor. The documented
workaround is to set BP_SPRING_CLOUD_BINDINGS_DISABLED=true at build time.
To keep the old builder for now, set it explicitly to
paketobuildpacks/builder-noble-java-tiny.
Metrics: LongTaskTimer is off by default. Boot no longer creates a
LongTaskTimer for active observations. If you graph in-flight requests or
long-running tasks from those meters, set
management.metrics.observations.include-active-long-task-timer=true, or
the panel goes quiet after the deploy and nobody notices for a week. While
you're in there: management.metrics.observations.ignored-meters was removed.
WebFlux multipart has limits now. spring.webflux.multipart.max-parts
defaults to 50 and max-disk-usage-per-part to 1MB, where both used to be
unlimited. An upload endpoint that accepted large files yesterday will start
rejecting them. Set -1 to remove a limit, or better, pick a real number.
Smaller ones worth a grep. spring.data.redis.database is now honored
with master-replica setups (before, you always got database 0, so check
which database your data is actually in before upgrading). Spring Boot no
longer manages the Janino version, since Logback dropped its Janino support,
so declare a version yourself if you still depend on it. Set and Map configuration properties now keep the order from
your config file. And everything deprecated in 4.0 has been removed in 4.2.
Upgrade path: from 3.5, 4.0 and 4.1
Where you start decides how much work this is.
From 4.1: a normal minor upgrade. Go to the latest 4.1 patch (4.1.3, released the same day as 4.2.0), get the build green, then bump to 4.2.0 and work through the list above. Most of it is configuration.
From 4.0: this one has a deadline. Open source support for 4.0 ends on December 31, 2026. You can go straight to 4.2, but deprecated-in-4.0 APIs are removed in 4.2, so do it in two moves: first move to the latest 4.0 patch and fix every deprecation warning the compiler gives you while those APIs still exist. Then jump to 4.2 and handle the behavior changes. Going through 4.1 is optional; on a small service you can usually skip it.
From 3.5: this is the real migration. Open source support for 3.5 ended on June 30, 2026 (commercial support continues to 2032, if you pay for it). The 3.5 to 4.0 step is the generation change: Spring Framework 7, Jakarta EE 11, the modular starters, Jackson 3. Treat that as its own project, staged and tested on its own, and only then come forward to 4.2. Don't try to do both jumps in a single pull request. When a build fails you want to know which upgrade broke it.
Whatever your starting point, two tools pay for themselves:
spring-boot-properties-migrator. Add it as a runtime dependency during the upgrade. It reports renamed and removed properties at startup, and in 4.2 it can fail the app on errors or warnings, so you can make CI fail fast instead of reading logs by hand. Remove it when you're done.- Compiler deprecation warnings. Turn them on
(
-Dmaven.compiler.showDeprecation=truewith Maven) and treat the list as your to-do list for the next upgrade. That's how I confirmed theRestTemplatewarnings above.
I've done the 2.7 to 3.5 version of this across 45 microservices. Whether it's one service or forty-five, the safe way is to change one concern at a time: get the build green on the new version first, then fix one category of breakage per commit. If you're still on 2.7, start with Upgrading Spring Boot 2.7 to 3.x: The Checklist.
When should you adopt it?
There's no single right answer, but a reasonable policy looks like this. Try 4.2.0 in CI now, on a branch, and let it tell you what breaks. Ship it first to services where a bad deploy is cheap to roll back. For the services that page someone at 3 a.m., many teams wait for the first patch release (4.2.1). Not because a .0 is bad, but because the first patch picks up regressions that only show up across thousands of real apps. The one date you can't move is December 31 if you're on 4.0.
If you're newer to Spring and wondering why the version numbers matter this much, What Is Spring Boot, and Why Did It Replace Plain Java EE? explains what the framework is doing for you underneath. And if you're turning on the new OpenTelemetry conventions, pair it with the health and metrics setup from Spring Boot Actuator and Health Checks.
Sources
- Spring Boot 4.2.0 available now (spring.io blog, November 19, 2026)
- Spring Boot 4.2 Release Notes (Spring Boot wiki)
- System Requirements (Spring Boot 4.2.0 reference docs)
- Spring Boot support policy and endoflife.date/spring-boot for support dates