yoann esnaud
yoann esnaud

Reputation: 113

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

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.

Upvotes: 4

Views: 1674

Answers (1)

Guillaume Smet
Guillaume Smet

Reputation: 10529

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).

Upvotes: 2

Related Questions