Spring Boot 3 will release in November 2022. The release candidate 2 has already been released.
Spring Boot 3 will ship with Spring AOT. Spring AOT generates additional source code so that reflection calls will be avoided.
Spring AOT was introduced to generate GraalVM Native Images. However, in theory Spring AOT could also be used for regular JVM applications to speed up the start-up process (since regular calls should be faster than reflection calls).
Unfortunately, I didn't find anything about how to use Spring AOT for regular JVM applications in the Spring Boot 3 reference documentation. Do you know how I can profit from Spring AOT in a regular JVM application?
This document descibes how to run AOT code on the JRE.
Essentially, you have to build your jar like this
mvn clean compile spring-boot:process-aot package
and run it like this
java -DspringAot=true -jar your-application.jar
Now it is possible to run Spring applications in Ahead-of-Time mode:
For Gradle, you need to ensure that your build includes the
org.springframework.boot.aotplugin.When the JAR has been built, run it with
spring.aot.enabledsystem property set to true. For example:$ java -Dspring.aot.enabled=true -jar myapplication.jar ........ Starting AOT-processed MyApplication ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With