-
Notifications
You must be signed in to change notification settings - Fork 41.5k
Description
While loading of YAML files in home directory was fixed in #19081 it appears it is ignoring the profiles defined by the spring.profiles property and loading in all YAML documents (the sections in a YAML file) as property sources.
When running the example application with the example spring-boot-devtools.yaml with no profiles activate I would expect only one YAML document to be loaded, the top one which should be "default" property scope.
Example Project:
devtools-profile-loading.zip
I have added log statements to enumerate the loading property sources and just by starting up the example project you can see that all documents in spring-boot-devtools.yaml are loaded.
./mvn spring-boot-run
Example ~/.config/spring-boot/spring-boot-devtools.yaml:
spring-boot-devtools.yaml.txt
default.profile.property: "Default Profile Property"
---
spring:
profiles: p1
p1.profile.property: "from p1"
---
spring:
profiles: p2
p2.profile.property: "from p2"
---
spring:
profiles: p3
p2.profile.property: "from p3"
---
spring:
profiles: p1 & p2
p1-p2.profile.property: "from p1 & p2"
---
spring:
profiles: p2 & p3
p2-p3.profile.property: "from p2 & p3"
---
spring:
profiles: p1 & p3
p1-p3.profile.property: "from p1 & p3"
---
spring:
profiles:
- p1
- p2
- p3
p1-or-p2-or-p3.profile.property: "from p1 | p2 | p3"