@ -23,7 +23,7 @@ For more info about Spring Batch, see the {spring-batch}[Spring Batch project pa
Spring Batch auto-configuration is enabled by adding `@EnableBatchProcessing` to one of your `@Configuration` classes.
If a single `Job` is found in the application context, it is executed on startup (see {spring-boot-autoconfigure-module-code}/batch/JobLauncherApplicationRunner.java[`JobLauncherApplicationRunner`] for details).
If multiple `Job`s are found, the job that should be executed must be specified using configprop:spring.batch.job.name[].
If multiple ``Job``s are found, the job that should be executed must be specified using configprop:spring.batch.job.name[].
To disable running a `Job` found in the application content, set the configprop:spring.batch.job.enabled[] to `false.`
Reflection hints are automatically created for configuration properties by the Spring ahead-of-time engine.
Nested configuration properties which are no inner classes, however, *must* be annotated with `@NestedConfigurationProperty`, otherwise they won't be detected and will not be bindable.
Nested configuration properties which are not inner classes, however, *must* be annotated with `@NestedConfigurationProperty`, otherwise they won't be detected and will not be bindable.
include::code:MyProperties[]
@ -35,7 +35,7 @@ NOTE: Please use public getters and setters in all cases, otherwise the properti
It is possible to convert a Spring Boot <<executable-jar#appendix.executable-jar, executable jar>> into a native image as long at the jar contains the AOT generated assets.
It is possible to convert a Spring Boot <<executable-jar#appendix.executable-jar, executable jar>> into a native image as long as the jar contains the AOT generated assets.
This can be useful for a number of reasons, including:
* You can keep your regular JVM pipeline and turn the JVM application into a native image on your CI/CD platform.
@ -97,7 +97,7 @@ Assuming an AOT processed Spring Boot executable jar built as `myproject-0.0.1-S
$ mv myproject ../
----
NOTE: These commands work on Linux or MacOS machines, you will need to adapt them for Windows.
NOTE: These commands work on Linux or macOS machines, but you will need to adapt them for Windows.
TIP: The `@META-INF/native-image/argfile` might not be packaged in your jar.
It is only included when reachability metadata overrides are needed.
@ -151,7 +151,7 @@ For further reading, please see {graal-native-image-docs}/metadata/AutomaticMeta
[[native-image.advanced.custom-hints]]
=== Custom Hints
If you need to provide your own hints for reflection, resources, serialization, proxy usage etc. you can use the `RuntimeHintsRegistrar` API.
Create a class that implements the `RuntimeHintsRegistrar` interface, then make appropriate calls to the provided `RuntimeHints` instance:
Create a class that implements the `RuntimeHintsRegistrar` interface, and then make appropriate calls to the provided `RuntimeHints` instance:
@ -33,20 +33,20 @@ The resulting image doesn't contain a JVM, instead the native image is compiled
This leads to smaller images.
NOTE: The builder used for the images is `paketobuildpacks/builder:tiny`.
It has small footprint and reduced surface attack, but you can also use `paketobuildpacks/builder:base` or `paketobuildpacks/builder:full` to have more tools available in the image if required.
It has small footprint and reduced attack surface, but you can also use `paketobuildpacks/builder:base` or `paketobuildpacks/builder:full` to have more tools available in the image if required.
Docker should be installed, see https://docs.docker.com/installation/#installation[Get Docker] for more details.
Docker should be installed. See https://docs.docker.com/installation/#installation[Get Docker] for more details.
https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user[Configure it to allow non-root user] if you are on Linux.
NOTE: You can run `docker run hello-world` (without `sudo`) to check the Docker daemon is reachable as expected.
Check the {spring-boot-maven-plugin-docs}/#build-image-docker-daemon[Maven] or {spring-boot-gradle-plugin-docs}/#build-image-docker-daemon[Gradle] Spring Boot plugin documentation for more details.
TIP: On MacOS, it is recommended to increase the memory allocated to Docker to at least `8GB`, and potentially add more CPUs as well.
See this https://stackoverflow.com/questions/44533319/how-to-assign-more-memory-to-docker-container/44533437#44533437[Stackoverflow answer] for more details.
TIP: On macOS, it is recommended to increase the memory allocated to Docker to at least `8GB`, and potentially add more CPUs as well.
See this https://stackoverflow.com/questions/44533319/how-to-assign-more-memory-to-docker-container/44533437#44533437[Stack Overflow answer] for more details.
On Microsoft Windows, make sure to enable the https://docs.docker.com/docker-for-windows/wsl/[Docker WSL 2 backend] for better performance.
@ -92,7 +92,7 @@ To build the image, you can run the `spring-boot:build-image` goal with the `nat
* There is no lazy class loading, everything shipped in the executables will be loaded in memory on startup.
* There are some limitations around some aspects of Java applications that are not fully supported.
TIP: The {graal-native-image-docs}/metadata/Compatibility/[Native Image Compatibility Guide] section of the GraalVM reference documentation provide more details about GraalVM limitations.
TIP: The {graal-native-image-docs}/metadata/Compatibility/[Native Image Compatibility Guide] section of the GraalVM reference documentation provides more details about GraalVM limitations.
@ -126,7 +126,7 @@ TIP: Generated hint files can be found in `target/spring-aot/main/resources` whe
Spring sometimes needs to generate proxy classes to enhance the code you've written with additional features.
To do this, it uses the cglib library which directly generates bytecode.
When an application is running on the JDK, proxy classes are generated dynamically as the application runs.
When an application is running on the JVM, proxy classes are generated dynamically as the application runs.
When creating a native image, these proxies need to be created at build-time so that they can be included by GraalVM.
NOTE: Unlike source code generation, generated bytecode isn't particularly helpful when debugging an application.