-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Config files no longer loaded if they contain a hidden path element #23983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Sorry for the inconvenience, @mwftapi. Thank you for the detailed analysis of the problem. |
Glad if I can help! Thank you for managing such an amazing framework! Keep up the good work! ❤️ |
This also breaks applications packaged as war and deployed with Eclipse + Tomcat, since Eclipse uses the hidden folder |
I wonder if we can restrict ignoring |
Uh oh!
There was an error while loading. Please reload this page.
Since upgrading from
Spring Boot Version 2.3.4
toSpring Boot Version 2.3.5
a application no longer loads properties from property files that are located in config locations that contain a hidden path element.This can be reproduced by setting the
spring.config.additional-location
to a location that contains a hidden path element as shown in the following snippet:As seen in the example code snippet the additional config location given contains a
hidden path element
, namely.location
.If we put a file named
application-some-active-profile.yml
into/additional/config/.location/
this file will not be loaded by the org/springframework/boot/context/config/ConfigFileApplicationListener.java upon start up when running with-Dspring.profiles.active=some-active-profile
.This is because of the check in Line 525 of the ConfigFileApplicationListener.
spring-boot/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java
Line 525 in d87c437
This check will strip all path elements and check them for a starting
.
. Since the constructed resource pathfile:/application/config/.location/application-some-active-profile.yml
contains the.location
path element the resource will not be loaded.spring-boot/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/config/ConfigFileApplicationListener.java
Line 572 in d87c437
This change was introduced with the following commit.
This issue is reproducible with all config file types:
properties
,xml
,yaml
,yml
.This issue is not reproducible with
Spring Boot Version 2.3.4
.The text was updated successfully, but these errors were encountered: