Aaron's Blog

https://aaronchenwei.github.io/

View on GitHub
25 November 2022

Spring Boot 3.0 Goes GA

by aaronchenwei

Spring Blog announced that Spring Boot 3.0 is now generally available and 3.0.0 can be found in Maven Central on November 24, 2022.

1. Highlights of the new release include:

2. Migrate to Spring Boot 3.0

We could follow the official Migration Guide.

Please read this guide carefully, especially for the Spring features that are used in your applications.

3. What is New?

3.1. Java 17

Java 17 brings lots of new language features and JVM features. You refer my blog

4. Jakarta EE 9

The most important change might be the jump from Java EE to Jakarta EE9, where the package namespace changed from javax.* to jakarta.*. As a result, we need to adjust all imports in our code whenever we use classes from Java EE directly.

For example, when we access the HttpServletRequest object within our Spring MVC Controller, we need to replace:

import javax.servlet.http.HttpServletRequest;

with

import jakarta.servlet.http.HttpServletRequest;

5. Native Executables

Building native executables and deploying them to GraalVM gets a higher priority. So the Spring Native initiative is moving into Spring proper.

For AOT generation, there’s no need to include separate plugins, we can just use a new goal of the spring-boot-maven-plugin:

$ mvn spring-boot:aot-generate

The native application can be built as follows:

$ mvn spring-boot:build-image

# or
$ gradle bootBuildImage