Commit aa175996 authored by Andy Wilkinson's avatar Andy Wilkinson

Clarify handling of files specified in spring.config.location

Closes gh-5147
parent 70ab6134
...@@ -470,7 +470,11 @@ property (typically OS env, system property or command line argument). ...@@ -470,7 +470,11 @@ property (typically OS env, system property or command line argument).
If `spring.config.location` contains directories (as opposed to files) they should end If `spring.config.location` contains directories (as opposed to files) they should end
in `/` (and will be appended with the names generated from `spring.config.name` before in `/` (and will be appended with the names generated from `spring.config.name` before
being loaded). The default search path `classpath:,classpath:/config,file:,file:config/` being loaded, including profile-specific file names). Files specified in
`spring.config.location` are used as-is, with no support for profile-specific variants,
and will be overridden by any profile-specific properties.
The default search path `classpath:,classpath:/config,file:,file:config/`
is always used, irrespective of the value of `spring.config.location`. This search path is always used, irrespective of the value of `spring.config.location`. This search path
is ordered from lowest to highest precedence (`file:config/` wins). If you do specify is ordered from lowest to highest precedence (`file:config/` wins). If you do specify
your own locations, they take precedence over all of the default locations and use the your own locations, they take precedence over all of the default locations and use the
...@@ -506,6 +510,10 @@ If several profiles are specified, a last wins strategy applies. For example, pr ...@@ -506,6 +510,10 @@ If several profiles are specified, a last wins strategy applies. For example, pr
specified by the `spring.profiles.active` property are added after those configured via specified by the `spring.profiles.active` property are added after those configured via
the `SpringApplication` API and therefore take precedence. the `SpringApplication` API and therefore take precedence.
NOTE: If you have specified any files in `spring.config.location`, profile-specific
variants of those files will not be considered. Use directories in`spring.config.location`
if you also want to also use profile-specific properties.
[[boot-features-external-config-placeholders-in-properties]] [[boot-features-external-config-placeholders-in-properties]]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment