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

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

Code Ape Tech Column
Code Ape Tech Column
Code Ape Tech Column
What’s New in Spring Boot 4? A Deep Dive into the Latest Spring Ecosystem Overhaul

Spring Boot 4 has been officially released, coinciding with major version upgrades of Spring Framework 7, Spring Data 2025.1, and Spring AI 1.1, marking a comprehensive, non‑routine overhaul of the entire Spring ecosystem.

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

Spring Framework 7 still runs on JDK 17 but recommends the latest LTS release, JDK 25, and adopts Jakarta EE 11 as the new baseline. Key component versions include:

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

Consequently, the javax.* packages are removed, and 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 are adjusted.

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

The Spring codebase now fully adopts JSpecify annotations, replacing the older JSR‑305 style. This change improves Kotlin‑Java inter‑operability and introduces precise null‑value semantics for generics, arrays, and var‑args.

3. Build‑Time Optimizations with Project Leyden

Spring’s traditional “runtime magic”—classpath scanning, dynamic proxies, reflection, and conditional auto‑configuration—has caused slow startup and complex native image builds. Spring Boot 4 and Framework 7 shift these activities to build time, leveraging Project Leyden to generate code ahead‑of‑time.

4. Modern HTTP Client and Testing Toolchain

RestTemplate

enters a deprecation countdown (marked @Deprecated in 7.1).

A declarative HTTP client is introduced via @HttpExchange, with group configuration support via @ImportHttpServices. RestTestClient provides a non‑reactive alternative to WebTestClient, supporting both MockMvc and real server testing.

Test contexts now auto‑pause/resume, reducing background resource usage.

5. Full‑Stack Support for Jackson 3

Spring now defaults to Jackson 3.x (package tools.jackson), deprecating Jackson 2, which will be removed in Spring 7.2. Migration notes:

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

6. Native API Versioning

Spring MVC and WebFlux now offer built‑in API version management via request headers, parameters, or media types, with support for marking versions as deprecated. The configuration properties spring.mvc.apiversion.* and spring.webflux.apiversion.* are auto‑configured.

7. Built‑In Fault Tolerance

Spring acknowledges that distributed systems default to failure, and therefore integrates common resilience patterns directly into the core framework. Example:

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

Developers no longer need to add spring-retry, Resilience4j, or extra configuration for retries, making applications lighter and more cloud‑native.

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 reduced analysis scope for native images.

9. OpenTelemetry Integration

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

10. Dual‑Track AI Strategy

Spring AI is evolving on two parallel tracks:

Spring AI 1.1 – stable integration with major LLM providers via starters, automatic MCP/JSON mapping, and declarative tool registration using ChatClient.

Spring AI 2.x – deep redesign for future‑proofing, fully compatible with Spring Boot 4 and Jakarta EE 11, rebuilt ChatClient API, built‑in JSpecify null‑safety contracts, and tight integration of MCP and AOT compilation.

These tracks give developers a choice between a mature, maintenance‑oriented stack (Framework 6 + Boot 3 + AI 1.1) and an aggressive, forward‑looking stack (Framework 7 + Boot 4 + AI 2.x) for 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.

BackendJavaAIobservabilitySpring BootFrameworkjakarta-ee
Code Ape Tech Column
Written by

Code Ape Tech Column

Former Ant Group P8 engineer, pure technologist, sharing full‑stack Java, job interview and career advice through a column. Site: java-family.cn

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.