diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/SpringBootApplication.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/SpringBootApplication.java index 1001bfc538..cd61b7321d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/SpringBootApplication.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/SpringBootApplication.java @@ -58,7 +58,7 @@ public @interface SpringBootApplication { * Exclude specific auto-configuration classes such that they will never be applied. * @return the classes to exclude */ - @AliasFor(annotation = EnableAutoConfiguration.class, attribute = "exclude") + @AliasFor(annotation = EnableAutoConfiguration.class) Class[] exclude() default {}; /** @@ -67,7 +67,7 @@ public @interface SpringBootApplication { * @return the class names to exclude * @since 1.3.0 */ - @AliasFor(annotation = EnableAutoConfiguration.class, attribute = "excludeName") + @AliasFor(annotation = EnableAutoConfiguration.class) String[] excludeName() default {}; /** diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestComponent.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestComponent.java index df4b392f05..27b6f44187 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestComponent.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestComponent.java @@ -24,6 +24,7 @@ import java.lang.annotation.Target; import org.springframework.boot.context.TypeExcludeFilter; import org.springframework.context.annotation.ComponentScan; +import org.springframework.core.annotation.AliasFor; import org.springframework.stereotype.Component; /** @@ -50,6 +51,7 @@ public @interface TestComponent { * a Spring bean in case of an auto-detected component. * @return the specified bean name, if any */ + @AliasFor(annotation = Component.class) String value() default ""; } diff --git a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestConfiguration.java b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestConfiguration.java index 11703db79f..3ba1dab80c 100644 --- a/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestConfiguration.java +++ b/spring-boot-project/spring-boot-test/src/main/java/org/springframework/boot/test/context/TestConfiguration.java @@ -24,6 +24,7 @@ import java.lang.annotation.Target; import org.springframework.boot.SpringBootConfiguration; import org.springframework.context.annotation.Configuration; +import org.springframework.core.annotation.AliasFor; /** * {@link Configuration @Configuration} that can be used to define additional beans or @@ -47,6 +48,7 @@ public @interface TestConfiguration { * Configuration class. See {@link Configuration#value()} for details. * @return the specified bean name, if any */ + @AliasFor(annotation = Configuration.class) String value() default ""; } diff --git a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/MetaEndpoint.java b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/MetaEndpoint.java index b571c66870..d9fd85ac6b 100644 --- a/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/MetaEndpoint.java +++ b/spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationsample/MetaEndpoint.java @@ -22,14 +22,18 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.springframework.core.annotation.AliasFor; + @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Endpoint public @interface MetaEndpoint { + @AliasFor(annotation = Endpoint.class) String id(); + @AliasFor(annotation = Endpoint.class) boolean enableByDefault() default true; } diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java index bebd4a4c82..a2c0f8d04b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/jackson/JsonComponent.java @@ -25,6 +25,7 @@ import java.lang.annotation.Target; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonSerializer; +import org.springframework.core.annotation.AliasFor; import org.springframework.stereotype.Component; /** @@ -67,6 +68,7 @@ public @interface JsonComponent { * a Spring bean in case of an autodetected component. * @return the component name */ + @AliasFor(annotation = Component.class) String value() default ""; }