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.
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+
@Configurationto@AutoConfigurationthe filespring-configuration-metadata.jsonis not generated anymore with the content ofadditional-spring-configuration-metadata.json.The reason is that
org.springframework.boot.configurationprocessor.ConfigurationMetadataAnnotationProcessoris excuted only if the following annotations are present:Before switching to
@AutoConfigurationthe@Configurationwas present and the processor was executed. I am not sure what the best fix would be.As
@SupportedAnnotationTypesdoes not seem to consider inherited annotations the easiest fix would be to add@AutoConfigurationto the supported annotation types.But i do not see why any of the annotations would be necessary to enable
ConfigurationMetadataAnnotationProcessoras the presents ofadditional-spring-configuration-metadata.jsonshould enable processing.