Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can you access resources in transitive jar used in native image?

Tags:

quarkus

I am using a third-party library in my quarkus project. This third-party library has a transitive dependency which includes some inner resources.

These resources are loaded at runtime, and seem to work when executing my quarkus project in dev mode, however, when running the built native image, these resources are not found.

Is there a way to include this transitive dependency resources in the built native image? I tried to specifically include the library in my gradle dependency but that did not work.

Thanks.

like image 546
yoann esnaud Avatar asked Oct 28 '25 00:10

yoann esnaud


1 Answers

By default, the resources are not included in the native image.

You need to include them yourself.

See our extensive documentation about the various issues you can have with GraalVM native executable and how to solve them here: https://quarkus.io/guides/writing-native-applications-tips#including-resources (the link points to your specific issue but better read the whole doc for a global understanding).

like image 89
Guillaume Smet Avatar answered Oct 31 '25 01:10

Guillaume Smet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!