Closed
Description
Describe the bug
Due to some reflections you encounter errors during the runtime when github-api
is used in a native image.
Example
at java.base@22.0.1/java.lang.invoke.LambdaForm$DMH/sa346b79c.invokeStaticInit(LambdaForm$DMH)\nCaused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `org.kohsuke.github.GHRepository`: cannot deserialize from Object value (no delegate- or property-based Creator): this appears to be a native image, in which case you may need to configure reflection for the class that is to be deserialized\n at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 1, column: 2]
To Reproduce
Steps to reproduce the behavior:
- Build an application with Spring Boot Native and
github-api
- Perform a
native-image
build - Run the native application
Expected behavior
github-api
should be used in a native image without any issues
Desktop (please complete the following information):
N/A
Additional context
You could add META-INF/native-image/<groupid>/<artifactid>/reflect-config.json
and describe the reflection usage:
Example:
[
{
"name": "org.kohsuke.github.GHRepository",
<settings for reflections>
}
]