Share
From Spring Boot 2 to Spring Boot 3 with Java 22 and Jakarta EE
Jakarta EE 9 changed its package namespace from `javax.*` to `jakarta.*`. This may sound like a trivial change that mostly affects Jakarta EE. So, why should Spring developers care?
As it turns out, the namespace changes ripple throughout the entire Java ecosystem. And Spring is no exception. Spring Framework 6 and Spring Boot 3 raised their baseline to Jakarta EE 9 API level which is supported by Tomcat 10 and Jetty 11 for example.
Attending this session will teach you how to make this migration as smooth as possible. A live coding demo will take you through the steps involved, and point out where to pay special attention.
We will also briefly examine some of the changes planned for **Jakarta EE 11** that will prepare you for what to expect in future versions of Spring.
ivargrimstad
Transcript
67 slides
-
From Spring Boot 2 To Spring Boot 3 with Java
2122 and Jakarta EE Ivar Grimstad Jakarta EE Developer Advocate Eclipse Foundation -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Speci fi cation Document API TCK Final Speci fi cation Compatible Implementation(s) Speci fi -
Jakarta EE 10 Web Pro fi Jakarta EE 10 Platform
Updated Not Updated New Authorization 2.1 Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0 -
Jakarta EE 10 Core Pro fi Jakarta EE 10 Web
Pro fi le Updated Not Updated New RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0 -
Jakarta EE 10 Core Pro fi le Updated Not Updated
New RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta EE 10 API source level: Java SE 11 API binary level: Java SE 11 TCK run with: Java SE 11+17 App Developers (YOU) can use Java SE 17 features if you like!! -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) How is this Relevant to ? -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) builds on -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) javax.* -> jakarta.* -
Authorization Activation Batch Connectors Mail Messaging Enterprise Beans RESTful Web
Services JSON Processing JSON Binding Annotations CDI Lite Interceptors Dependency Injection Servlet Pages Expression Language Debugging Support Standard Tag Libraries Faces WebSocket Enterprise Beans Lite Persistence Transactions CDI Authentication Concurrency Security Validation Data Jakarta EE Authorization Activation Batch Connectors Mail Messaging Enterprise Beans RESTful Web Services JSON Processing JSON Binding Annotations CDI Lite Interceptors Dependency Injection Servlet Pages Expression Language Debugging Support Standard Tag Libraries Faces WebSocket Enterprise Beans Lite Persistence Transactions CDI Authentication Concurrency Security Validation Data Spring -
Authorization Activation Batch Connectors Mail Messaging Enterprise Beans RESTful Web
Services JSON Processing JSON Binding Annotations CDI Lite Interceptors Dependency Injection Servlet Pages Expression Language Debugging Support Standard Tag Libraries Faces WebSocket Enterprise Beans Lite Persistence Transactions CDI Authentication Concurrency Security Validation Data Jakarta EE Spring Persistence -
UUID as Basic Java Type @Entity public class Item {
@Id @GeneratedValue(strategy=GenerationType.UUID) private java.util.UUID id; private String description; … } -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Persistence 3.2 https://jakarta.ee/speci fi cations/persistence/3.2/ -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Java Records as Embeddable Classes -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) @PersistenceContext EntityManger em; @Inject EntityManger em; -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) PersistenceConfiguration -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Deprecate Calendar, Date, Time, Timestamp, Temporal, MapKeyTemporal, TemporalType Replace with java.time API Java Con fi guration as alternative to persistence.xml via the PersistenceConfiguration Class Lots of New Convenience methods for Criteria Language -
Authorization Activation Batch Connectors Mail Messaging Enterprise Beans RESTful Web
Services JSON Processing JSON Binding Annotations CDI Lite Interceptors Dependency Injection Servlet Pages Expression Language Debugging Support Standard Tag Libraries Faces WebSocket Enterprise Beans Lite Persistence Transactions CDI Authentication Concurrency Security Validation Data Jakarta EE Spring Validation -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Validation 3.1 https://jakarta.ee/speci fi cations/bean-validation/3.1/ -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Support Java Records -
Authorization Activation Batch Connectors Mail Messaging Enterprise Beans RESTful Web
Services JSON Processing JSON Binding Annotations CDI Lite Interceptors Dependency Injection Servlet Pages Expression Language Debugging Support Standard Tag Libraries Faces WebSocket Enterprise Beans Lite Persistence Transactions CDI Authentication Concurrency Security Validation Data Jakarta EE Spring Servlet -
Authorization Activation Batch Connectors Mail Messaging Enterprise Beans RESTful Web
Services JSON Processing JSON Binding Annotations CDI Lite Interceptors Dependency Injection Servlet Pages Expression Language Debugging Support Standard Tag Libraries Faces WebSocket Enterprise Beans Lite Persistence Transactions CDI Authentication Concurrency Security Validation Data Jakarta EE Spring Authorization Activation Batch Connectors Mail Messaging Enterprise Beans RESTful Web Services JSON Processing JSON Binding Annotations CDI Lite Interceptors Dependency Injection Servlet Pages Expression Language Debugging Support Standard Tag Libraries Faces WebSocket Enterprise Beans Lite Persistence Transactions CDI Authentication Concurrency Security Validation Data Authorization Activation Batch Connectors Mail Messaging Enterprise Beans RESTful Web Services JSON Processing JSON Binding Annotations CDI Lite Interceptors Dependency Injection Servlet Pages Expression Language Debugging Support Standard Tag Libraries Faces WebSocket Enterprise Beans Lite Persistence Transactions CDI Authentication Concurrency Security Validation Data -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Demo -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) New Spring App Scenario 1 -
Spring Boot 3 + Tomcat 9 duke-spring Spring Boot 3
+ Tomcat 10 duke-spring -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Upgrade Spring App Scenario 2 -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) javax.* -> jakarta.* -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) IDE -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) 1. Update Spring version in pom.xml 2. Update Jakarta EE version in pom.xml 3. Fix the imports https://github.com/ivargrimstad/jakartaee-spring -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Upgrade Spring App Scenario 3 with Dependencies -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) 1. Update Spring version in pom.xml 2. Update Jakarta EE version in pom.xml 3. Fix the imports 4. Repeat for Dependencies https://github.com/ivargrimstad/jakartaee-spring -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Upgrade Spring App Scenario 4 with Transitive Dependencies -
Spring Boot 2 duke-boot duke-dep duke-lib Spring Boot 3 duke-boot
duke-dep duke-lib -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Transformation -
Spring Boot 2 duke-boot duke-dep duke-lib Spring Boot 3 duke-boot
duke-dep duke-lib 2.0 1.0 2.0 1.0 -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) 1. Update Spring version in pom.xml 2. Update Jakarta EE version in pom.xml 3. Fix the imports 4. Repeat for Dependencies 5. Transform Libraries if necessary https://github.com/ivargrimstad/jakartaee-spring -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Additional Migration Steps -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) 1. Update Spring version in pom.xml 2. Update Jakarta EE version in pom.xml 3. Fix the imports 4. Repeat for Dependencies 5. Transform Libraries if necessary 6. Rename properties pre fi xed with javax 7. Verify data and dynamic content https://github.com/ivargrimstad/jakartaee-spring -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Java 22 -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Beyond 10 -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Boost Your Performance and Developer Productivity with Jakarta EE 11 and Java 21 Java/JVM Track Today at 18:00 -
COPYRIGHT (C) 2022, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Summary -
Jakarta EE 10 Platform Updated Not Updated New Authorization 2.1
Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0 -
Authorization 3.0 Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1
Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.2 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0 Under Developm ent -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) How is Relevant to -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) builds on -
Jakarta EE Spring Authorization Activation Batch Connectors Mail Messaging Enterprise
Beans RESTful Web Services JSON Processing JSON Binding Annotations CDI Lite Interceptors Dependency Injection Servlet Pages Expression Language Debugging Support Standard Tag Libraries Faces WebSocket Enterprise Beans Lite Persistence Transactions CDI Authentication Concurrency Security Validation Data Jakarta EE 11 Platform -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) javax.* -> jakarta.* -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) 1. Update Spring version in pom.xml 2. Update Jakarta EE version in pom.xml 3. Fix the imports 4. Repeat for Dependencies 5. Transform Libraries if necessary 6. Rename properties pre fi xed with javax 7. Verify data and dynamic content https://github.com/ivargrimstad/jakartaee-spring -
Jakarta EE https://jakarta.ee Get Started https://start.jakarta.ee Ivar’s Hashtag Jakarta EE
https://www.agilejava.eu/category/jakarta-ee/ Demo Code https://github.com/ivargrimstad/jakartaee-spring