-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wildcard resource pattern doesn't work with Gradle plugin #639
Comments
@melix are you familiar with this way of registering resources:
|
I forgot to include the documentation I was looking at: https://www.graalvm.org/latest/reference-manual/native-image/metadata/#resource-metadata-in-json For what it's worth, the docs for GraalVM for JDK 21 (which is what I'm using) don't talk about using wildcards, but they do include examples of patterns with wildcards: https://www.graalvm.org/jdk21/reference-manual/native-image/metadata/#resource-metadata-in-json I'm assuming these docs are applicable to the Gradle plugin, but if they're not, then this could simply be a case of insufficient documentation for the Gradle plugin, and I haven't correctly configured the resource inclusion pattern for the Gradle plugin. |
So when you add the includes/excludes in the DSL block like this:
what will happen is that the generated resources configuration file will simply have an additional include pattern:
This file is used during compilation, so if the resource is missing, I would suspect a different problem. There's nothing specific to Gradle here, it's simply copying the pattern to the configuration file. |
Sure, it's entirely possible that this is a bug with the native image builder itself, and is unrelated to the Gradle plugin, but I'm using the Gradle plugin so that's what I reported it as. 😛 Since I didn't know if I could reproduce it without the plugin. Your theory sounds correct that it's probably not the plugin, but do you know what the issue is, then? Is it a problem with the actual native image builder? Does GraalVM 21 not support wild cards for resource patterns, or something? |
Before reporting
Describe the bug
When trying to include resources from a Jar in the project dependencies, using a wild card pattern doesn't work to include the files. Only specifying the files explicitly by name ensures they are included in the native image.
Make sure that you have read the documentation and that you are using the latest plugin version.
To Reproduce
A reproducible example can be found here
Steps to reproduce the behavior:
Please use backticks to properly format code.
If possible please attach a complete reproducer here (either as a zip file or as a link to public repository/branch).
Expected behavior
All files in the META-INF/resources/webjars/swagger-ui/5.17.11 folder from the
org.webjars:swagger-ui:5.17.11
library should be included in the produce native image.Logs
Add logs to help explain your problem.
Please use backticks to properly format big logs. Example:
System Info (please complete the following information):
Oracle GraalVM 21.0.5+9.1
21.0.5+9-LTS
id("org.graalvm.buildtools.native") version "0.10.3"
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: