You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"Classpath wildcard patterns cannot be used as a search location");
validateWildcardLocation(path);
if (!ResourceUtils.isUrl(path)) {
path = ResourceUtils.FILE_URL_PREFIX + path;
}
}
locations.add(path);
}
}
returnlocations;
}
will turn these locations into file:optional:file:/foo and file:optional:/bar.
The following code will then decide that the Resource file:optional:file:/foo/application.properties does not exist, (while file:/foo/application.properties would exist)
This can cause ordering issues between internal and external configuration files, depending on the execution order of BootstrapConfigFileApplicationListener and ConfigDataEnvironmentPostProcessor (so #1213 will hide this problem)
When BootstrapConfigFileApplicationListener runs first, we get this order:
external properties (not found by spring cloud because of this bug)
internal properties (found by BootstrapConfigFileApplicationListener)
external-properties (found by ConfigDataEnvironmentPostProcessor)
internal properties (found by ConfigDataEnvironmentPostProcessor)
When ConfigDataEnvironmentPostProcessor runs first, we get this order:
external-properties (found by ConfigDataEnvironmentPostProcessor)
internal properties (found by ConfigDataEnvironmentPostProcessor)
external properties (not found by spring cloud because of this bug)
internal properties (found by BootstrapConfigFileApplicationListener)
In the first case, the internal properites suddenly get precedence before the external ones.
The text was updated successfully, but these errors were encountered:
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Describe the bug
BootstrapConfigFileApplicationListener can't handle
spring.config.additional-location
s withoptional:
prefixes.When setting
spring.config.additional-location
tooptional:file:/foo
oroptional:/bar
,spring-cloud-commons/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/BootstrapConfigFileApplicationListener.java
Lines 701 to 718 in 1a387e1
file:optional:file:/foo
andfile:optional:/bar
.The following code will then decide that the Resource
file:optional:file:/foo/application.properties
does not exist, (whilefile:/foo/application.properties
would exist)spring-cloud-commons/spring-cloud-context/src/main/java/org/springframework/cloud/bootstrap/BootstrapConfigFileApplicationListener.java
Lines 501 to 508 in 1a387e1
This can cause ordering issues between internal and external configuration files, depending on the execution order of
BootstrapConfigFileApplicationListener
andConfigDataEnvironmentPostProcessor
(so #1213 will hide this problem)When
BootstrapConfigFileApplicationListener
runs first, we get this order:external properties(not found by spring cloud because of this bug)BootstrapConfigFileApplicationListener
)ConfigDataEnvironmentPostProcessor
)ConfigDataEnvironmentPostProcessor
)When
ConfigDataEnvironmentPostProcessor
runs first, we get this order:ConfigDataEnvironmentPostProcessor
)ConfigDataEnvironmentPostProcessor
)external properties(not found by spring cloud because of this bug)BootstrapConfigFileApplicationListener
)In the first case, the internal properites suddenly get precedence before the external ones.
The text was updated successfully, but these errors were encountered: