From 8b15c3f7c60d19caece539fcc7ed9a69f4031dce Mon Sep 17 00:00:00 2001 From: spencergibb Date: Fri, 28 Aug 2020 22:19:13 -0400 Subject: [PATCH] Sets spring.config.on-location-not-found=ignore for config server. See https://github.com/spring-projects/spring-boot/issues/23097 --- .../server/environment/NativeEnvironmentRepository.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/NativeEnvironmentRepository.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/NativeEnvironmentRepository.java index ea8f3da4..2a9e8112 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/NativeEnvironmentRepository.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/NativeEnvironmentRepository.java @@ -219,7 +219,9 @@ public class NativeEnvironmentRepository // map.put("encrypt.failOnError=" + this.failOnError); map.put("spring.config.location", StringUtils.arrayToCommaDelimitedString( getLocations(application, profile, label).getLocations())); - map.put("spring.config.all-locations-optional", true); + // globally ignore config files that are not found + map.put("spring.config.all-locations-optional", true); //TODO: remove old property + map.put("spring.config.on-location-not-found", "ignore"); environment.getPropertySources() .addFirst(new MapPropertySource("config-data-setup", map)); return environment;