Deprecate config paths (#1336)

This commit is contained in:
erabii
2023-05-08 15:32:30 +03:00
committed by GitHub
parent 944c7d70e0
commit 977a8ccfac
3 changed files with 5 additions and 0 deletions

View File

@@ -99,6 +99,7 @@ public abstract class ConfigMapPropertySourceLocator implements PropertySourceLo
private void addPropertySourcesFromPaths(Environment environment, CompositePropertySource composite) {
Set<String> uniquePaths = new LinkedHashSet<>(properties.paths());
LOG.warn("path support is deprecated and will be removed in a future release. Please use spring.config.import");
LOG.debug("paths property sources : " + uniquePaths);
uniquePaths.stream().map(Paths::get).filter(p -> {
boolean exists = Files.exists(p);

View File

@@ -112,6 +112,8 @@ public abstract class SecretsPropertySourceLocator implements PropertySourceLoca
protected void putPathConfig(CompositePropertySource composite) {
LOG.warn("path support is deprecated and will be removed in a future release. Please use spring.config.import");
this.properties.paths().stream().map(Paths::get).filter(Files::exists).flatMap(x -> {
try {
return Files.walk(x);