You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
spring-configuration-metadata.json is missing for additional-spring-configuration-metadata.json after switching from @Configuration to @AutoConfiguration
#31186
Closed
marbon87 opened this issue
May 27, 2022
· 2 comments
We are providing custom AutoConfigurations for company specific configurations and have a few maven modules that contain only auto-configurations and spring-configuration-metadata.json files.
After updating to Spring Boot 2.7 and switching from spring.factories+@Configuration to @AutoConfiguration the file spring-configuration-metadata.json is not generated anymore with the content of additional-spring-configuration-metadata.json.
The reason is that org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor is excuted only if the following annotations are present:
@SupportedAnnotationTypes({ ConfigurationMetadataAnnotationProcessor.CONFIGURATION_PROPERTIES_ANNOTATION,
ConfigurationMetadataAnnotationProcessor.CONTROLLER_ENDPOINT_ANNOTATION,
ConfigurationMetadataAnnotationProcessor.ENDPOINT_ANNOTATION,
ConfigurationMetadataAnnotationProcessor.JMX_ENDPOINT_ANNOTATION,
ConfigurationMetadataAnnotationProcessor.REST_CONTROLLER_ENDPOINT_ANNOTATION,
ConfigurationMetadataAnnotationProcessor.SERVLET_ENDPOINT_ANNOTATION,
ConfigurationMetadataAnnotationProcessor.WEB_ENDPOINT_ANNOTATION,
"org.springframework.context.annotation.Configuration" })
public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor {
Before switching to @AutoConfiguration the @Configuration was present and the processor was executed. I am not sure what the best fix would be.
As @SupportedAnnotationTypes does not seem to consider inherited annotations the easiest fix would be to add @AutoConfiguration to the supported annotation types.
But i do not see why any of the annotations would be necessary to enable ConfigurationMetadataAnnotationProcessor as the presents of additional-spring-configuration-metadata.json should enable processing.
The text was updated successfully, but these errors were encountered:
marbon87
changed the title
spring-configuration-metadata.json is missing after switching from Configuration to AutoConfiguration for additional-spring-configuration-metadata.json
spring-configuration-metadata.json is missing after switching from @Configuration to @AutoConfiguration for additional-spring-configuration-metadata.json
May 27, 2022
marbon87
changed the title
spring-configuration-metadata.json is missing after switching from @Configuration to @AutoConfiguration for additional-spring-configuration-metadata.json
spring-configuration-metadata.json is missing for additional-spring-configuration-metadata.json after switching from @Configuration to @AutoConfiguration
May 27, 2022
@marbon87 Thanks for reporting this. Just to make sure that I've understood the problem, am I right in thinking that you don't have any @ConfigurationProperties-annotated types in the affected modules are you're relying purely on manual metadata?
We are providing custom AutoConfigurations for company specific configurations and have a few maven modules that contain only auto-configurations and spring-configuration-metadata.json files.
After updating to Spring Boot 2.7 and switching from spring.factories+
@Configuration
to@AutoConfiguration
the filespring-configuration-metadata.json
is not generated anymore with the content ofadditional-spring-configuration-metadata.json
.The reason is that
org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessor
is excuted only if the following annotations are present:Before switching to
@AutoConfiguration
the@Configuration
was present and the processor was executed. I am not sure what the best fix would be.As
@SupportedAnnotationTypes
does not seem to consider inherited annotations the easiest fix would be to add@AutoConfiguration
to the supported annotation types.But i do not see why any of the annotations would be necessary to enable
ConfigurationMetadataAnnotationProcessor
as the presents ofadditional-spring-configuration-metadata.json
should enable processing.The text was updated successfully, but these errors were encountered: