Skip to content

Commit aa17599

Browse files
committed
Clarify handling of files specified in spring.config.location
Closes gh-5147
1 parent 70ab613 commit aa17599

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,11 @@ property (typically OS env, system property or command line argument).
470470

471471
If `spring.config.location` contains directories (as opposed to files) they should end
472472
in `/` (and will be appended with the names generated from `spring.config.name` before
473-
being loaded). The default search path `classpath:,classpath:/config,file:,file:config/`
473+
being loaded, including profile-specific file names). Files specified in
474+
`spring.config.location` are used as-is, with no support for profile-specific variants,
475+
and will be overridden by any profile-specific properties.
476+
477+
The default search path `classpath:,classpath:/config,file:,file:config/`
474478
is always used, irrespective of the value of `spring.config.location`. This search path
475479
is ordered from lowest to highest precedence (`file:config/` wins). If you do specify
476480
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
506510
specified by the `spring.profiles.active` property are added after those configured via
507511
the `SpringApplication` API and therefore take precedence.
508512

513+
NOTE: If you have specified any files in `spring.config.location`, profile-specific
514+
variants of those files will not be considered. Use directories in`spring.config.location`
515+
if you also want to also use profile-specific properties.
516+
509517

510518

511519
[[boot-features-external-config-placeholders-in-properties]]

0 commit comments

Comments
 (0)