-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Document that spring-boot-configuration-processor cannot detect default value defined externally #22685
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
Comments
Depending on exactly where the constant is defined, I have a feeling that it may not be possible to access it from the annotation processor. Can you please expand a bit on what you mean by "and the constant not in current class". Is the constant defined in another class in the project that's being compiled, or is it an external dependency? |
another class or another jar |
Thanks. That's a bit ambiguous. Do you mean another class in another jar, or you have two different cases one where the class is in the same project and one where it is in another jar? |
yes, two cases |
One case is another class in same project. |
That's a current limitation of the annotation processor I am afraid. We need to browse through source code elements to figure out what the default value should be and we support a limited set of use cases at the moment.
This won't be supported. We don't have access to the source code of classes that are not being compiled so we can't infer what the elements we have in the current class refers to. |
We've discussed this one at the team meeting and decided to document the limitation (which is what I've just done). If you need to configure your constants externally, I am afraid we won't be able to detect those. |
<artifactId>spring-boot-configuration-processor</artifactId>
cannot generate the default value to thespring-configuration-metadata.json
when the field default value is a constant and the constant not in current class.The text was updated successfully, but these errors were encountered: