This repository provides a basic web application using Spring Boot 3 that can be built as a native image using GraalVM.
It showcases how reflection and resources loading can be configured using RuntimeHints
.
This sample can be seen in action in Ahead Of Time and Native in Spring Boot 3.0.
To build this demo application, you need GraalVM 23.0 on your path.
If you use SDKMan
, invoke the following:
sdk install java 23.0.3.r17-nik
See also GraalVM Quickstart
To build the application with Maven, you need to enable the native
profile:
$ ./mvnw -Pnative native:compile
You can run your unit tests in a native image to verify that your application and its dependency work as expected.
To run your tests in a native image with Maven, you need to enable the nativeTest
profile:
$ ./mvnw -PnativeTest test