Skip to content

Latest commit

 

History

History
60 lines (38 loc) · 1.39 KB

README.adoc

File metadata and controls

60 lines (38 loc) · 1.39 KB

AOT and Native with Spring Boot 3

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.

Building

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

Maven

To build the application with Maven, you need to enable the native profile:

$ ./mvnw -Pnative native:compile

Gradle

To build the application with Gradle, you need to make sure that the org.graalvm.buildtools.native plugin is enabled.

$ ./gradlew nativeCompile

Testing

You can run your unit tests in a native image to verify that your application and its dependency work as expected.

Maven

To run your tests in a native image with Maven, you need to enable the nativeTest profile:

$ ./mvnw -PnativeTest test

Gradle

To run your tests in a native image with Gradle, you need to make sure that the org.graalvm.buildtools.native plugin is enabled.

$ ./gradlew nativeTest