-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Document how and where to add custom GraalVM configuration files #42515
Comments
What part of the doc clashes with this? I think we're lacking some guidance in this area. It is true that our AOT infrastructure takes control and will generate metadata in If you decide to write manual metadata using the same namespace in the same module, they will be overwritten at the moment. You can use a different namespace for this, something like src/main/resources/META-INF/native-image//-manual/. Or you can write the metadata in a different module with its own artifactId and include that in your application. Have you tried any of that? |
It is mentioned that in this folder GraalVM
Sure this is working if you pack it into a separate dependency which is not using the If you use a custom namespace this would require you to use |
Sorry I don't see how that section refers to the Spring Boot plugin or where it is said that manual metadata is merged automatically. Can you please quote exactly what you think implies that the Spring Boot plugin "clashes with the documentation"?
For a start, I wasn't aware that GraalVM would let you pick any namespace you want in Assuming that's what it does, the reason would be exactly that, GraalVM doesn't support picking up such resources from two locations automatically so you have to separate them or configure the plugin. That's what I'd recommend for the time being anyway. As for merging manual input, we can consider it, I'll flag for team attention to get more feedback from the team. |
This is not what I'm seeing. I'm using This also works with So what Stephane said:
is true, isn't it? |
Yes you can use a different namespace and as I said it is no problem to do so. Also we just used RuntimeHints and those are adding the definitions to the generated hint files with the groupid and artifactid of our project. Just wanted to mention the overwriting as this might be confusing. |
You said that it worked but that “this would require you to use |
Here is a complete log of a build: awslabs/aws-crt-java#834 (comment) there you can see the hint „ 4 experimental option(s) unlocked:“ It is working without |
I don't think that those warnings are caused by your I have a project with the following structure:
(reachability-metadata.json is for GraalVM 23, reflect-config.json for GraalVM 17). GraalVM 17 doesn't give me any warning, GraalVM 23 shows this:
Neither of those warnings are caused by my I've attached the build logs and the project, so I think the workaround mentioned by Stephane is valid and will be valid in the future. But I'll double check with the GraalVM native-image team. |
Thanks a lot for all the time you already spent! Just to summarize the workarounds:
(1) It is not required to add the files provided via custom namespace with for example |
I just thought about (1) of the previous comment. Maybe the fix for the Edit: If this is ok for you I could provide the PR 🙂. |
The GraalVM team confirmed that it's okay to put multiple folders under
And this is also documented on GraalVM side here:
The first thing we should do is to document that problem and the workaround in our documentation. |
Version information
Spring Boot version: 3.3.4
Bug description
When you place a
reflection-config.json
proxy-config.json
resource-config.json
serialization-config.json
into
src/main/resources/META-INF/native-image/<groupid>/<artifactid>/
and you perform a
process-aot
withspring-boot-maven-plugin
the configuration files that you have defined in your project are not merged with those the plugin is generating.Instead the plugin overwrites the configuration which clashes with the documentation of https://www.graalvm.org/latest/reference-manual/native-image/metadata/.
The current workaround is that you have to write a
RuntimeHintsRegistrar
and define the definitions there.With a
RuntimeHintsRegistrar
the plugin is adding the entries to the desired files.The text was updated successfully, but these errors were encountered: