From 6393569d4222bcab11bd2f7816d40c5bc61b3fe8 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Tue, 25 Aug 2015 15:22:02 +0200 Subject: [PATCH] Polish Externalized Configuration section Closes gh-3823 --- .../src/main/asciidoc/spring-boot-features.adoc | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc index 1abaff9687e..58be6140cda 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -224,7 +224,9 @@ Spring Boot allows you to externalize your configuration so you can work with th application code in different environments. You can use properties files, YAML files, environment variables and command-line arguments to externalize configuration. Property values can be injected directly into your beans using the `@Value` annotation, accessed -via Spring's `Environment` abstraction or bound to structured objects. +via Spring's `Environment` abstraction or +<> +via `@ConfigurationProperties`. Spring Boot uses a very particular `PropertySource` order that is designed to allow sensible overriding of values, properties are considered in the the following order: @@ -244,7 +246,8 @@ sensible overriding of values, properties are considered in the the following or variants). . Application properties packaged inside your jar (`application.properties` and YAML variants). -. `@PropertySource` annotations on your `@Configuration` classes. +. {spring-javadoc}/context/annotation/PropertySource.{dc-ext}[`@PropertySource`] annotations + on your `@Configuration` classes. . Default properties (specified using `SpringApplication.setDefaultProperties`). To provide a concrete example, suppose you develop a `@Component` that uses a @@ -315,7 +318,8 @@ following locations and add them to the Spring `Environment`: . A classpath `/config` package . The classpath root -The list is ordered by precedence (locations higher in the list override lower items). +The list is ordered by precedence (properties defined in locations higher in the list +override those defined in lower locations). NOTE: You can also <> as an alternative to '.properties'.