It seems that by default the native image generated by Quarkus does not include any classpath resources corresponding to stuff from src/main/resources/
.
From the GraalVM docs, I sort of understand why this happens, but now I'm stuck. Is there a way to configure the quarkus-maven-plugin
to include the resources in the native image?
Kubernetes-native Quarkus allows developers to automatically generate Kubernetes resources including building and deploying container images without having to manually create YAML files.
Quarkus makes registration of reflection in an extension a breeze by using ReflectiveClassBuildItem , thus eliminating the need for a JSON configuration file. More information about reflection in GraalVM can be found here.
For compilation native-image depends on the local toolchain. Install glibc-devel , zlib-devel (header files for the C library and zlib ) and gcc , using a package manager available on your OS. Some Linux distributions may additionally require libstdc++-static .
Quarkus needs GraalVM installation for building the native executables.
We have a layer to do that programmatically in extensions but, right now, we don't have any user facing API for applications.
So for the time being, you could use this option of the quarkus-maven-plugin:
<quarkus.native.additional-build-args>-H:ResourceConfigurationFiles=resources-config.json</quarkus.native.additional-build-args>
Or you can also define it in your application.properties
:
quarkus.native.additional-build-args =-H:ResourceConfigurationFiles=resources-config.json
Everything is documented here: https://quarkus.io/guides/writing-native-applications-tips .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With