3

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.

yoann esnaud
  • 73
  • 1
  • 1
  • 3

1 Answers1

1

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

Guillaume Smet
  • 9,921
  • 22
  • 29
  • yep that worked, thanks! one thing, the documentation for including the resources config using gradle is almost incorrect... it should be: additionalBuildArgs = [ "-H:ResourceConfigurationFiles=resources/main/resources-config.json" ] – yoann esnaud Oct 10 '19 at 06:18
  • Could you submit a pull request to fix it? And if you can have a look at the rest of this doc from a Gradle perspective, that would be helpful! – Guillaume Smet Oct 11 '19 at 07:20
  • 3
    @yoannesnaud I know this thread is old but it would be interesting to know how you managed to include the transitive dependency resources – jsalvas Mar 07 '22 at 15:59