Skip to content

Document how and where to add custom GraalVM configuration files #42515

Closed
@klopfdreh

Description

@klopfdreh

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 with spring-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.

@Configuration
@ImportRuntimeHints(MyRuntimeHints.class)
@Slf4j
public class MyRuntimeHints implements RuntimeHintsRegistrar {
    @Override
    public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
      //....
    }
}

With a RuntimeHintsRegistrar the plugin is adding the entries to the desired files.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions