Commit 9382cd4d authored by Madhura Bhave's avatar Madhura Bhave

Polish wildcard location documentation

parent 3f9d0058
...@@ -396,10 +396,18 @@ On your application classpath (for example, inside your jar) you can have an `ap ...@@ -396,10 +396,18 @@ On your application classpath (for example, inside your jar) you can have an `ap
When running in a new environment, an `application.properties` file can be provided outside of your jar that overrides the `name`. When running in a new environment, an `application.properties` file can be provided outside of your jar that overrides the `name`.
For one-off testing, you can launch with a specific command line switch (for example, `java -jar app.jar --name="Spring"`). For one-off testing, you can launch with a specific command line switch (for example, `java -jar app.jar --name="Spring"`).
NOTE: Spring Boot also supports wildcard locations when loading configuration files. Spring Boot also supports wildcard locations when loading configuration files.
By default, a wildcard location of `config/*/` outside of your jar is supported. By default, a wildcard location of `config/*/` outside of your jar is supported.
Wildcard locations are also supported when specifying `spring.config.additional-location` and `spring.config.location`. Wildcard locations are also supported when specifying `spring.config.additional-location` and `spring.config.location`.
Wildcard locations are particularly useful in an environment such as Kubernetes when there are multiple sources of config properties.
For example, if you have some Redis configuration and some MySQL configuration, you might want to keep those two pieces of configuration separate, while requiring that both those are present in an `application.properties` that the app can bind to.
This might result in two separate `application.properties` files mounted at different locations such as `/config/redis/application.properties` and `/config/mysql/application.properties`.
In such a case, having a wildcard location of `config/*/`, will result in both files being processed.
NOTE: Locations with wildcards are not processed in a deterministic order and files that match the wildcard cannot be used to override keys in the other.
[[boot-features-external-config-application-json]] [[boot-features-external-config-application-json]]
[TIP] [TIP]
==== ====
......
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