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 59b90d5e0423..d5072739227d 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 @@ -257,11 +257,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: * configprop:spring.config.name[] (configprop:spring.config.name[format=envvar]): 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 527c053930cb..cb1493b4af74 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 @@ -369,7 +369,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: