What’s New in Spring Boot 4? A Deep Dive into the Latest Features

Spring Boot 4 launches alongside Spring Framework 7, Spring Data 2025.1 and Spring AI 1.1, introducing Jakarta EE 11, JDK 25, JSpecify null‑safety, build‑time optimizations with Project Leyden, a new declarative HTTP client, Jackson 3 support, native API versioning, built‑in resilience, OpenTelemetry integration, and a dual‑track AI strategy.

Architect's Tech Stack
Architect's Tech Stack
Architect's Tech Stack
What’s New in Spring Boot 4? A Deep Dive into the Latest Features

Spring Boot 4 has been officially released, coinciding with a coordinated major version bump of several Spring projects: Spring Framework 7, Spring Data 2025.1, and Spring AI 1.1. This release is not a routine patch but a comprehensive rewrite of the entire Spring ecosystem.

1. Underlying Dependency Upgrade: Jakarta EE 11 + JDK 25

Spring Framework 7 still runs on JDK 17 but strongly recommends the latest LTS release, JDK 25, and adopts Jakarta EE 11 as the new baseline. Key specifications have been updated:

Servlet 6.1 (Tomcat 11.0 / Jetty 12.1)

JPA 3.2 (Hibernate ORM 7.1/7.2)

Bean Validation 3.1 (Hibernate Validator 9.0+)

WebSocket 2.2

Kotlin 2.2 and GraalVM 25 support

The old javax.* packages are removed; annotations such as @javax.annotation.PostConstruct and @javax.inject.Inject must be migrated to the jakarta.* namespace. Undertow is dropped because it does not support Servlet 6.1, and the underlying implementations of WebFlux and WebSocket have been adjusted.

2. Null‑Safety Revolution: From JSR‑305 to JSpecify

The Spring codebase now fully adopts JSpecify annotations, replacing the legacy JSR‑305 style. This change improves Kotlin‑Java inter‑operability and provides precise null‑semantic descriptions for generics, arrays, and var‑args.

3. Build‑Time Optimizations with Project Leyden

Spring’s traditional “runtime magic” (classpath scanning, dynamic proxies, reflection, conditional auto‑configuration) has been shifted to build time. By moving these mechanisms earlier, startup time is reduced and native image generation becomes simpler.

4. Modern HTTP Client and Testing Toolchain

RestTemplate

is now deprecated (marked @Deprecated in 7.1).

A new declarative HTTP client is introduced, using @HttpExchange to generate implementations automatically.

Support for grouped configuration via @ImportHttpServices.

New RestTestClient replaces the non‑reactive WebTestClient, offering MockMvc‑style testing with real‑server support.

Test contexts can now auto‑pause and resume, lowering resource consumption.

5. Full‑Stack Support for Jackson 3

Spring now defaults to Jackson 3.x (package tools.jackson). Jackson 2 is deprecated and will be removed in Spring 7.2. Migration notes:

Annotations remain in com.fasterxml.jackson for a smoother transition. Jackson2ObjectMapperBuilder is no longer provided; use JsonMapper.builder() instead.

6. Native API Versioning

Spring MVC and WebFlux now include built‑in API version management via properties spring.mvc.apiversion.* and spring.webflux.apiversion.*. Versions can be resolved from request headers, parameters, or media types, and can be marked as deprecated.

7. Built‑In Resilience: Retry, Rate‑Limiting, Circuit‑Breaker

Spring acknowledges that distributed systems default to failure, so common resilience patterns are now part of the core framework. Example:

@Retryable(maxAttempts = 3)
public List<Order> getOrders() { ... }

No longer need to add spring-retry, Resilience4j, or extra configuration.

8. Modular Auto‑Configuration

Auto‑configuration has been split into finer‑grained modules, resulting in more accurate IDE hints, lighter AOT code generation, and a smaller analysis surface for native images.

9. OpenTelemetry Integration

The new spring-boot-starter-opentelemetry starter brings native OpenTelemetry support, tightly integrated with Micrometer to export metrics, traces, and logs via OTLP.

10. AI Dual‑Track Strategy

Spring AI now follows two parallel development lines:

Spring AI 1.1 – stable, starter‑based integration with major LLM providers, automatic MCP/JSON mapping, and deep ChatClient integration.

Spring AI 2.x – future‑focused rewrite, fully compatible with Spring Boot 4 and Jakarta EE 11, rebuilt ChatClient API, built‑in JSpecify null‑safety, and deeper MCP/AOT integration.

Consequently, two upgrade paths emerge:

Framework 6 + Boot 3 + AI 1.1 – stable, mature, suited for maintenance‑heavy systems.

Framework 7 + Boot 4 + AI 2.x – aggressive, forward‑looking, targeting the next decade.

图片
图片
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

JavaAIBackend DevelopmentOpenTelemetrySpring Bootjakarta-eeJSpecify
Architect's Tech Stack
Written by

Architect's Tech Stack

Java backend, microservices, distributed systems, containerized programming, and more.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.