Blog logo on a black background with the words "Discover What's Next in Tech!"

Spring Boot 3.0 comes with Native Image Support - The new features summarized

Spring Boot has established itself as one of the most important frameworks for the development of Java applications. It was developed to simplify the creation of production-ready applications and offers a wide range of functions that make life easier for developers.

Spring Boot Logo

(Spring Boot logo, source: https://twitter.com/springboot)

 

A new Major version of the framework was published on November 24, 2022 published. In this blog post, we take a summarized look at the new features of the Version 3.0.

Version upgrades

Spring Boot 3.0 is used in practice in conjunction with numerous other dependencies. For a Spring Boot 3.0 application, updates to these dependencies mean the implementation of new migration requirements, consideration during implementation, but also a range of new features.

Java

Spring Boot requires the version Java 17 as a minimum version. If an application is still in version Java 8 or 11, the JDK must first be updated in order to migrate to the new Spring Boot version. Use with Java 19 was tested in this version and the possibility was confirmed.

GraalVM

GraalVM also has a requirement for a minimum version. The version of the runtime environment must be at least 22.3 are located.

Spring Framework

Spring Boot is based on the Spring Framework. The new version requires the Spring Framework version 6.

Spring projects

A lot has changed in terms of versions of dependencies and libraries used in conjunction with Spring Boot 3.0. In the same release of the new version of Spring Boot, other Spring projects were also updated, including Spring Security 6.0, Spring Kafka 3.0 and Spring Session 3.0. A list of all new versions of the Spring projects can be found in the Release Notes to find.

From Java EE to Jakarta EE

A migration from Java EE to Jakarta EE API for all dependencies has been implemented in this release. Where possible, Jakarta EE 10 compatible dependencies were selected. A list of the Jakarta versions used can be found in the Release Notes to find.

Third Party JARs

The upgrade of JAR files from all third-party providers has also not been neglected for this purpose. Dependencies such as Kotlin 1.7.20, Log4j 2.18, Couchbase Client 3.4 or ElasitcSearch Client 8.5 are supported with Spring Boot 3.0. Of course, there are many more than those mentioned. A list compiled by the Spring Boot developers completes the list. It is available in the Release Notes to find.

New features

The most important new features are summarized below, starting with one of the most interesting in the new release:

GraalVM Native Image Support (Spring Native)

It is now possible to run Spring Boot 3.0 applications in GraalVM native images to convert, which Significant memory and start time improvements makes it possible.

Log4j2 improvements

Log4j2 support has been updated with new extensions that provide profile-dependent configuration, environment properties lookup and Log4j2 system properties.

Improved @ConstructorBinding detection

When using constructor-bound @ConfigurationProperties, the @ConstructorBinding annotation is no longer required if the class has a single parameterized constructor. If it has more than one constructor, @ConstructorBinding must still be used to tell Spring Boot which constructor to use.

Micrometer updates

Spring Boot 3.0 supports the new Observation APIs introduced in Micrometer 1.10. Tracing support has been added for Brave, OpenTelemetry, Zipkin and Wavefront.

Prometheus support

Auto-configuration for Prometheus Exemplars has been added. A PUT request to Prometheus Push Gateway can be executed on shutdown.

Elasticsearch Java Client

Auto-Configuration for the new Elasticsearch Java Client has been introduced.

SpringBootTest with Main Methods

The @SpringBootTest annotation can now use the Main method of any @SpringBootConfiguration class found if it is available.

In addition to these changes, there have been some minor tweaks and improvements. For example, hostnames are no longer logged at startup to improve startup times and support for Java's SecurityManager has been removed.

Additional information

If you are in a situation where you need to migrate an existing Spring Boot application to the latest version, you can do this with a migration guide provided for this purpose. [2] possible. An alternative would be to wait until May 2023, as the release of version 3.1 is scheduled for this period. [3]

 

Sources:

[1] https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Release-Notes

[2] https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.0-Migration-Guide

[3] https://spring.io/projects/spring-boot#support

 

Learn more about software development

 

Martin Maul

About ME

All contributions from Martin Maul

Learn more

Further information on our website and in our newsletter

Arrow up