Skip to content

Commit

Permalink
Ensure that config processor runs with only AutoConfiguration
Browse files Browse the repository at this point in the history
Fixes gh-31186
  • Loading branch information
wilkinsona committed May 27, 2022
1 parent d2397bd commit 682ac53
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2022 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -59,7 +59,8 @@
* @author Jonas Keßler
* @since 1.2.0
*/
@SupportedAnnotationTypes({ ConfigurationMetadataAnnotationProcessor.CONFIGURATION_PROPERTIES_ANNOTATION,
@SupportedAnnotationTypes({ ConfigurationMetadataAnnotationProcessor.AUTO_CONFIGURATION_ANNOTATION,
ConfigurationMetadataAnnotationProcessor.CONFIGURATION_PROPERTIES_ANNOTATION,
ConfigurationMetadataAnnotationProcessor.CONTROLLER_ENDPOINT_ANNOTATION,
ConfigurationMetadataAnnotationProcessor.ENDPOINT_ANNOTATION,
ConfigurationMetadataAnnotationProcessor.JMX_ENDPOINT_ANNOTATION,
Expand Down Expand Up @@ -97,6 +98,8 @@ public class ConfigurationMetadataAnnotationProcessor extends AbstractProcessor

static final String NAME_ANNOTATION = "org.springframework.boot.context.properties.bind.Name";

static final String AUTO_CONFIGURATION_ANNOTATION = "org.springframework.boot.autoconfigure.AutoConfiguration";

private static final Set<String> SUPPORTED_OPTIONS = Collections
.unmodifiableSet(Collections.singleton(ADDITIONAL_METADATA_LOCATIONS_OPTION));

Expand Down
Expand Up @@ -80,7 +80,8 @@ class ConfigurationMetadataAnnotationProcessorTests extends AbstractMetadataGene
@Test
void supportedAnnotations() {
assertThat(new ConfigurationMetadataAnnotationProcessor().getSupportedAnnotationTypes())
.containsExactlyInAnyOrder("org.springframework.boot.context.properties.ConfigurationProperties",
.containsExactlyInAnyOrder("org.springframework.boot.autoconfigure.AutoConfiguration",
"org.springframework.boot.context.properties.ConfigurationProperties",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.actuate.endpoint.annotation.Endpoint",
"org.springframework.boot.actuate.endpoint.jmx.annotation.JmxEndpoint",
Expand Down

0 comments on commit 682ac53

Please sign in to comment.