Running our native Spring Boot application inside GraalVM
The common convention when building an application for Spring Boot is to run ./mvnw clean package
. This cleans out the old cruft and creates a new uber JAR, something we already saw in Chapter 7, Releasing an Application with Spring Boot.
Building a Maven-based project with Spring Boot 3 requires that we have Java 17 installed. But to build a native image, we need to change course.
native-maven-plugin
mentioned in the previous section, which comes with the native
Maven profile, requires that we install a different JVM. There are additional tools required to build native images. The easiest way to manage different JVMs on our machine is by using sdkman (https://sdkman.io).
sdkman?
sdkman is an open source tool that allows you to install multiple JDKs and switch between them with ease. It’s as easy as sdk install java 17.0.3-tem
followed by sdk use java 17.0.3-tem
to download, install, and switch to the Eclipse...