diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureAfter.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureAfter.java index 3f9ab0eacb..e3bb47f88c 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureAfter.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureAfter.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -22,9 +22,18 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.DependsOn; + /** * Hint for that an {@link EnableAutoConfiguration auto-configuration} should be applied * after other specified auto-configuration classes. + *

+ * As with standard {@link Configuration @Configuration} classes, the order in which + * auto-configuration classes are applied only affects the order in which their beans are + * defined. The order in which those beans are subsequently created is unaffected and is + * determined by each bean's dependencies and any {@link DependsOn @DependsOn} + * relationships. * * @author Phillip Webb * @since 1.0.0 diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureBefore.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureBefore.java index 34c7191abf..5da0b3a3f9 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureBefore.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureBefore.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -22,9 +22,18 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.DependsOn; + /** - * Hint for that an {@link EnableAutoConfiguration auto-configuration} should be applied + * Hint that an {@link EnableAutoConfiguration auto-configuration} should be applied * before other specified auto-configuration classes. + *

+ * As with standard {@link Configuration @Configuration} classes, the order in which + * auto-configuration classes are applied only affects the order in which their beans are + * defined. The order in which those beans are subsequently created is unaffected and is + * determined by each bean's dependencies and any {@link DependsOn @DependsOn} + * relationships. * * @author Phillip Webb * @since 1.0.0 diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureOrder.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureOrder.java index 3c0092e070..ac9266cd90 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureOrder.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigureOrder.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 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. @@ -23,6 +23,8 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import org.springframework.context.annotation.AnnotationConfigApplicationContext; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.DependsOn; import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; @@ -31,6 +33,12 @@ import org.springframework.core.annotation.Order; * annotation. Allows auto-configuration classes to be ordered among themselves without * affecting the order of configuration classes passed to * {@link AnnotationConfigApplicationContext#register(Class...)}. + *

+ * As with standard {@link Configuration @Configuration} classes, the order in which + * auto-configuration classes are applied only affects the order in which their beans are + * defined. The order in which those beans are subsequently created is unaffected and is + * determined by each bean's dependencies and any {@link DependsOn @DependsOn} + * relationships. * * @author Andy Wilkinson * @since 1.3.0 diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index e52e6a27a2..15571dc3c5 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -7650,6 +7650,9 @@ For example, if you provide web-specific configuration, your class may need to b If you want to order certain auto-configurations that should not have any direct knowledge of each other, you can also use `@AutoConfigureOrder`. That annotation has the same semantic as the regular `@Order` annotation but provides a dedicated order for auto-configuration classes. +As with standard `@Configuration` classes, the order in which auto-configuration classes are applied only affects the order in which their beans are defined. +The order in which those beans are subsequently created is unaffected and is determined by each bean's dependencies and any `@DependsOn` relationships. + [[boot-features-condition-annotations]]