commit
d0e9168de0
|
|
@ -157,7 +157,7 @@ For further reading, please see {url-graal-docs-native-image}/metadata/Automatic
|
||||||
[[packaging.native-image.advanced.custom-hints]]
|
[[packaging.native-image.advanced.custom-hints]]
|
||||||
== 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.
|
If you need to provide your own hints for reflection, resources, serialization, proxy usage and so on, you can use the `RuntimeHintsRegistrar` API.
|
||||||
Create a class that implements the `RuntimeHintsRegistrar` interface, and 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:
|
||||||
|
|
||||||
include-code::MyRuntimeHints[]
|
include-code::MyRuntimeHints[]
|
||||||
|
|
@ -182,6 +182,15 @@ include-code::MyRuntimeHintsTests[]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[[packaging.native-image.advanced.custom-hints.static]]
|
||||||
|
=== Providing Hints Statically
|
||||||
|
If you prefer, custom hints can be provided statically in one or more GraalVM JSON hint files.
|
||||||
|
Such files should be placed in `src/main/resources/` within a `+META-INF/native-image/*/*/+` directory.
|
||||||
|
The xref:packaging/native-image/introducing-graalvm-native-images.adoc#packaging.native-image.introducing-graalvm-native-images.understanding-aot-processing[hints generated during AOT processing] are written to a directory named `+META-INF/native-image/{groupId}/{artifactId}/+`.
|
||||||
|
Place your static hint files in a directory that does not clash with this location, such as `+META-INF/native-image/{groupId}/{artifactId}-additional-hints/+`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[[packaging.native-image.advanced.known-limitations]]
|
[[packaging.native-image.advanced.known-limitations]]
|
||||||
== Known Limitations
|
== Known Limitations
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,13 +56,15 @@ A Spring AOT processed application will typically generate:
|
||||||
|
|
||||||
* Java source code
|
* Java source code
|
||||||
* Bytecode (for dynamic proxies etc)
|
* Bytecode (for dynamic proxies etc)
|
||||||
* GraalVM JSON hint files:
|
* GraalVM JSON hint files in `+META-INF/native-image/{groupId}/{artifactId}/+`:
|
||||||
- Resource hints (`resource-config.json`)
|
- Resource hints (`resource-config.json`)
|
||||||
- Reflection hints (`reflect-config.json`)
|
- Reflection hints (`reflect-config.json`)
|
||||||
- Serialization hints (`serialization-config.json`)
|
- Serialization hints (`serialization-config.json`)
|
||||||
- Java Proxy Hints (`proxy-config.json`)
|
- Java Proxy Hints (`proxy-config.json`)
|
||||||
- JNI Hints (`jni-config.json`)
|
- JNI Hints (`jni-config.json`)
|
||||||
|
|
||||||
|
If the generated hints are not sufficient, you can also xref:packaging/native-image/advanced-topics.adoc#packaging.native-image.advanced.custom-hints[provide your own].
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[[packaging.native-image.introducing-graalvm-native-images.understanding-aot-processing.source-code-generation]]
|
[[packaging.native-image.introducing-graalvm-native-images.understanding-aot-processing.source-code-generation]]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue