Spring Framework 6.x Release: Key Changes and Migration Guide

Spring Framework 6.x has been officially released, introducing Jakarta EE‑based packages for core annotations, requiring Hibernate‑Core‑Jakarta upgrades, updating servlet containers to Tomcat 10/Jetty 11/Undertow 2.2.14, and altering Web MVC/WebFlux behavior, with detailed migration steps and reference links.

JavaEdge
JavaEdge
JavaEdge
Spring Framework 6.x Release: Key Changes and Migration Guide

Spring Framework 6.x Release Overview

Spring Framework 6.x is officially released. The following summarizes the key migration changes.

Core Container

The @Inject annotation from JSR‑330 is now in the jakarta.inject package.

JSR‑250 annotations @PostConstruct and @PreDestroy have moved to jakarta.annotation.

Spring still detects the legacy javax equivalents for backward compatibility.

Data Access and Transactions

To align with Jakarta EE, replace the Hibernate core artifact with hibernate-core-jakarta and upgrade to Hibernate ORM 5.6.x. Switch the JPA API from javax.persistence to jakarta.persistence. Upgrade Hibernate Validator to 7.0.x, which is based on jakarta.validation.

Web Applications

Upgrade servlet containers to Jakarta‑compatible versions: Tomcat 10, Jetty 11, or Undertow 2.2.14.

Use the undertow-servlet-jakarta artifact and change imports from javax.servlet to jakarta.servlet.

Deprecated servlet integrations (Commons FileUpload, Tiles, FreeMarker JSP) have been removed. For multipart handling, use StandardServletMultipartResolver .

Spring MVC and Spring WebFlux no longer rely on type‑level @RequestMapping for controller detection. Interface‑based controllers may lose AOP proxy support unless class‑based proxies are enabled or the interface is annotated with @Controller. HttpMethod is now a regular class instead of an enum; replace EnumSet usage with Set and use conditional logic instead of switch.

References

https://github.com/spring-projects/spring-framework/issues/22154

https://github.com/spring-projects/spring-framework/issues/27697

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.

BackendJavamigrationspringjakarta-ee
JavaEdge
Written by

JavaEdge

First‑line development experience at multiple leading tech firms; now a software architect at a Shanghai state‑owned enterprise and founder of Programming Yanxuan. Nearly 300k followers online; expertise in distributed system design, AIGC application development, and quantitative finance investing.

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.