From a87a1f053f7109fc649498c91cfeaa86c2cac38b Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Fri, 25 Dec 2015 08:21:09 +0100 Subject: [PATCH] Polish documentation Clarify that "spring.config.*" properties doesn't work in configuration files. Closes gh-4838 --- .../src/main/asciidoc/appendix-application-properties.adoc | 2 +- spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc index 7252e27667..601cee365e 100644 --- a/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc +++ b/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc @@ -71,7 +71,7 @@ content into your application; rather pick only the properties that you need. spring.cache.jcache.provider= # Fully qualified name of the CachingProvider implementation to use to retrieve the JSR-107 compliant cache manager. Only needed if more than one JSR-107 implementation is available on the classpath. spring.cache.type= # Cache type, auto-detected according to the environment by default. - # SPRING CONFIG ({sc-spring-boot}/context/config/ConfigFileApplicationListener.{sc-ext}[ConfigFileApplicationListener]) + # SPRING CONFIG - using environment property only ({sc-spring-boot}/context/config/ConfigFileApplicationListener.{sc-ext}[ConfigFileApplicationListener]) spring.config.location= # Config file locations. spring.config.name=application # Config file name. 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 263c114dc1..c991494f25 100644 --- a/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/spring-boot-features.adoc @@ -449,6 +449,10 @@ or $ java -jar myproject.jar --spring.config.location=classpath:/default.properties,classpath:/override.properties ---- +WARNING: `spring.config.name` and `spring.config.location` are used very early to +determine which files have to be loaded so they have to be defined as an environment +property (typically OS env, system property or command line argument). + 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 being loaded). The default search path `classpath:,classpath:/config,file:,file:config/`