-
Notifications
You must be signed in to change notification settings - Fork 40.5k
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 the need for compilation with -parameters when targeting a native image #33182
Comments
@michalkrajcovic thanks for the report. See #31708. |
Apologizes for this, I must have misread something but I can't tell what now. |
The error is
There is a reflection hint for
It feels like |
I think that's exactly it. Boot's Gradle plugin sets |
The sample works with this addition to the tasks.named('compileJava').configure {
options.compilerArgs = ['-parameters']
} There's no way for us to do this automatically as Boot's plugin hasn't been applied (and nor should it have been in this case). I wonder if there's something else that we could do to make this work automatically. If including the class files as resources works, perhaps we could generate hints that do that if we detect that the standard reflection parameter information is missing? |
I've prototyped this and it works. I'd like to discuss this with team to see if it's something that we want to do or if we'd prefer to document the need to compile with |
We discussed this today and concluded that relying on |
Describe the bug
Spring Boot 3 Native - "Could not bind properties" error when properties class located in another module uses @ConstructorBinding in multi-module gradle project
To Reproduce
Environment
Sample project
https://github.com/michalkrajcovic/spring-native-multi-modules-bind-properties
Compile
Run
Fails with
Runs without issues on JVM
Expected behavior
Application starts without issues using JVM and native image.
Observation
Does not fail when properties class uses setters see brach setter. Also ConstructorBinding doesn't fail in single module project see branch single-module
Originally reported for Spring Boot 2.7.5 in spring-native
The text was updated successfully, but these errors were encountered: