Nov 30, 2022 2 min read

Spring Boot 3 and Spring Framework 6

Spring Boot 3 and Spring Framework 6
Spring Boot 3 and Spring Framework 6
Table of Contents

Spring Boot 3

Java 17 Baseline and Java 19 Support

Spring Boot 3.0 requires Java 17 as a minimum version. If you are currently using Java 8 or Java 11, you’ll need to upgrade your JDK before you can develop Spring Boot 3.0 applications.

Spring Boot 3.0 also works well and has been tested with JDK 19.

GraalVM Native Image Support

Spring Boot 3.0 applications can now be converted into GraalVM native images which can provide significant memory and startup-up performance improvements.

Spring Framework 6

JDK 17+ and Jakarta EE 9+ Baseline

  • The entire framework codebase is based on Java 17 source code level now.
  • Migration from javax to jakarta namespace for Servlet, JPA, etc.
import javax.servlet.http.HttpServletRequest;

with

import jakarta.servlet.http.HttpServletRequest;

Spring MVC

  • PathPatternParser used by default (with the ability to opt into PathMatcher).
  • Removal of outdated Tiles and FreeMarker JSP support.

Declarative HTTP Client

Interface-based, similar to Spring Cloud Feign

Declarative HTTP Client

Observability

With Spring 6, there was an Observability initiative that ended up with a new Micrometer Observation API and with the former Spring Cloud Sleuth project migrated to Micrometer Tracing. This is more for efficiently recording application metrics with Micrometer, and implementing tracing through providers, such as OpenZipkin or OpenTelemetry.

There's auto-configuration for all of these in Spring Boot 3, and the Spring projects are working on instrumenting themselves using the Observation API.

Migrating Project to Spring Boot 3

There are a few hints for project migration that we should know. The recommended steps are:

  1. Migrate to Spring Boot 2.7
  2. Check for deprecated code usage and legacy config file processing; it will be removed with the new major release
  3. Migrate to Java 17.
  4. Check third-party projects to have Jakarta EE 9 compatible releases
The difference between Spring Boot 2.7 and 3.0
Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to BugFix.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.