Refine global optional config data opt-out

Rename the opt-out property and use an enum in case we want to provide
additional options in the future.

Closes gh-23097
This commit is contained in:
Phillip Webb
2020-08-28 16:14:08 -07:00
parent bebb4363d6
commit 0ddd1b6ce8
11 changed files with 138 additions and 60 deletions

View File

@@ -623,8 +623,8 @@ You can use this prefix with the `spring.config.location` and `spring.config.add
For example, a `spring.config.import` value of `optional:file:./myconfig.properties` allows your application to start, even if the `myconfig.properties` file is missing.
If you want all locations to be considered optional, you can use the `spring.config.all-locations-optional` property.
Set the value to `true` using `SpringApplication.setDefaultProperties(...)` or with a system/environment variable.
If you want to ignore all `ConfigDataLocationNotFoundExceptions` and always continue to start your application, you can use the `spring.config.on-location-not-found` property.
Set the value to `ignore` using `SpringApplication.setDefaultProperties(...)` or with a system/environment variable.