Skip to content

A spring boot 3 project generating a native executable

Notifications You must be signed in to change notification settings

neogeogre/spring-native

Repository files navigation

GraalVM Native Support

Generate a spring boot 3 native app either in a docker image or an executable using graalVM.

You need a java graalVM distribution:

sdk install java 22.3.r17-nik

To create a docker image containing the native executable:

./gradlew bootBuildImage

Then, you can start the app with a container:

docker-compose -f docker-compose-spring-native.yaml up -d

Alternatively to create locally the native executable only run:

./gradlew clean nativeCompile

Then you can run the local app executable:

./build/native/nativeCompile/spring-native

Hit app endpoints with:

curl http:https://localhost:8080/api/books/

To run your existing tests in a native image, run the following goal:

./gradlew nativeTest

Start spring boot app using jar:

./gradlew bootRun

ref:

Releases

No releases published

Packages

No packages published

Languages