I currently have 4 YAML files
application.yaml
application-local.yaml
application-test.yaml
application-dev.yaml
I assume that application.yaml
is acting as default
.
In the other 3 files contains
spring:
profiles:
include: default
My problem is that my application.yaml
is very large
and it contains properties that are hierarchical.
For example,
connection:
baseUrl: 'http://localhost:5000'
brokerUrl: 'http://localhost:8082'
...
workspaces:
a:
width: 45
height: 100
...
b:
width: 56
height: 125
...
I would like to keep the content in current application.yaml
in multiple files in subfolders.
Let's say connection.yaml
will contain
connection:
baseUrl: 'http://localhost:5000'
brokerUrl: 'http://localhost:8082'
...
workspace-a.yaml
will contain
workspaces:
a:
width: 45
height: 100
...
and lastly, workspace-b.yaml
will contain
workspaces:
a:
width: 56
height: 125
...
at the end the structure will be like
/resources
application.yaml
application-local.yaml
application-test.yaml
application-dev.yaml
connection.yaml
/workspaces
a.yaml
b.yaml
I've tried to put the following code in application.yaml
but it didn't work.
spring:
profiles:
active: 'local'
include:
- connection.yaml
- workspaces/a.yaml
- workspaces/b.yaml
I also have tried different formats like
- classpath:/workspaces/a.yaml
- ./workspaces/a.yaml
- file:./workspaces/a.yaml
Please help :'(