This sample can be used to hack on Native with Spring Boot 3.
Note
|
This is a work in progress and requires a local build of Spring Boot. |
You need to install a version of Spring Boot 3.0.0-SNAPSHOT
from the aot
branch
$ git checkout aot $ ./gradlew publishToMavenLocal
You also need to have a native-image
in your path. The easiest way to get started
is with SDKMan:
$ sdk install java 22.0.0.2.r17-nik
Once GraalVM is installed, you need to use it in your shell:
$ sdk use java 22.0.0.2.r17-nik
Validate that GraalVM is available in your shell:
$ java -version openjdk version "17.0.2" 2022-01-18 LTS OpenJDK Runtime Environment GraalVM 22.0.0.2 (build 17.0.2+9-LTS) OpenJDK 64-Bit Server VM GraalVM 22.0.0.2 (build 17.0.2+9-LTS, mixed mode, sharing)
To build the project and generate a native image for it, run the following command:
$ ./mvnw package -Pnative