diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc index 8e093da906..d265855024 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -259,11 +259,6 @@ The actual application _now_ shows the banner (as overridden by configuration) a === Change the Location of External Properties of an Application By default, properties from different sources are added to the Spring `Environment` in a defined order (see "`<>`" in the '`Spring Boot features`' section for the exact order). -A nice way to augment and modify this ordering is to add `@PropertySource` annotations to your application sources. -Classes passed to the `SpringApplication` static convenience methods and those added using `setSources()` are inspected to see if they have `@PropertySources`. -If they do, those properties are added to the `Environment` early enough to be used in all phases of the `ApplicationContext` lifecycle. -Properties added in this way have lower priority than any added by using the default locations (such as `application.properties`), system properties, environment variables, or the command line. - You can also provide the following System properties (or environment variables) to change the behavior: * `spring.config.name` (`SPRING_CONFIG_NAME`): Defaults to `application` as the root of the file name. diff --git a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 36f644aa50..af8a83a11b 100644 --- a/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -351,7 +351,7 @@ Properties are considered in the following order: . <> packaged inside your jar (`application-\{profile}.properties` and YAML variants). . Application properties outside of your packaged jar (`application.properties` and YAML variants). . Application properties packaged inside your jar (`application.properties` and YAML variants). -. {spring-framework-api}/context/annotation/PropertySource.html[`@PropertySource`] annotations on your `@Configuration` classes. +. {spring-framework-api}/context/annotation/PropertySource.html[`@PropertySource`] annotations on your `@Configuration` classes (these are added late to the `Environment` and will not have any effect on anything that reads properties from the `Environment` before the `ApplicationContext` is refreshed, such as logging configuration and auto-configuration). . Default properties (specified by setting `SpringApplication.setDefaultProperties`). To provide a concrete example, suppose you develop a `@Component` that uses a `name` property, as shown in the following example: