Adjust order of property sources

@PropertySources *can* and should be added in the slot
after the application.properties (code that is part of the
application should have lower precedence than external
configuration).

Fixes gh-1044
This commit is contained in:
Dave Syer
2014-06-07 08:52:50 +01:00
parent e81e94924c
commit b75578d99c
11 changed files with 62 additions and 32 deletions

View File

@@ -207,11 +207,11 @@ sensible overriding of values, properties are considered in the the following or
. OS environment variables.
. JNDI attributes from `java:comp/env`
. A `RandomValuePropertySource` that only has properties in `random.*`.
. `@PropertySource` annotations on your `@Configuration` classes.
. Application properties outside of your packaged jar (`application.properties`
including YAML and profile variants).
. Application properties packaged inside your jar (`application.properties`
including YAML and profile variants).
. `@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