The following was discovered as part of building this project:
- The native build tools is not configured with the Kotlin DSL, check the documentation for more details.
- The following dependencies are not known to work with Spring Native: 'Embedded MongoDB Database, Spring Boot DevTools'. As a result, your application may not work as expected.
For further reference, please consider the following sections:
- Official Gradle documentation
- Spring Boot Gradle Plugin Reference Guide
- Create an OCI image
- Spring Native Reference Guide
- Spring Boot DevTools
- Spring Web
The following guides illustrate how to use some features concretely:
- Building a RESTful Web Service
- Serving Web Content with Spring MVC
- Building REST services with Spring
These additional references should also help you:
This project has been configured to let you generate either a lightweight container or a native executable.
If you're already familiar with Spring Boot container images support, this is the easiest way to get started with Spring Native. Docker should be installed and configured on your machine prior to creating the image, see the Getting Started section of the reference guide .
To create the image, run the following goal:
$ ./gradlew bootBuildImage
Then, you can run the app like any other container:
$ docker run --rm -p 8080:8080 bankaccount-api:0.0.1-SNAPSHOT
Use this option if you want to explore more options such as running your tests in a native image. The GraalVM native-image compiler should be installed and configured on your machine, see the Getting Started section of the reference guide .
To create the executable, run the following goal:
$ ./gradlew nativeBuild
Then, you can run the app as follows:
$ build/native-image/bankaccount-api