-
Notifications
You must be signed in to change notification settings - Fork 41.2k
How to load sub yml config file use spring.profiles.group property? #24309
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
You need to include the source profile as part of the group property (see https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-profiles-groups). For example: spring:
profiles:
group:
test:
- test-db
- test-quartz
- test-app For the spring:
profiles:
include:
- base-db
- base-quartz
- base-app |
Thanks,how does test-* inherit base-*? |
I think the example I included should so that. If not, please ask the question on stackoverflow.com with a small sample app. If you post a link to the question here, I'll try to answer it on stackoverflow. We prefer to keep the issue tracker just for bugs. |
@philwebb Thinks! spring:
profiles:
group:
test:
- base-app
- base-db
- base-quartz
base-app: test-app
base-db: test-db
base-quartz: test-quartz The inheritance relationship on the configuration looks a bit strange, but it works. BTW. The follow configuration should not work: spring:
profiles:
group:
test:
- test-app
- test-db
- test-quartz
test-app: base-app
test-db: base-db
test-quartz: base-quartz Because, by this way, the |
Ref: #24172 |
How to run the application using group name? |
@vignesh-ragavan As Phil said above, please ask questions on Stack Overflow. |
Uh oh!
There was an error while loading. Please reload this page.
Spring-Boot Version: 2.4.0
When migrate from spring.profiles.include to spring.profiles.group, Spring-Boot no longer load sub
yml
configs from the classpath.application.yml
main resource:

application-test.yml
test resource:

log shows Spring-Boot only load
application.yml
andapplication-test.yml
, but nobase-db
,base-quartz
,base-app
,test-db
,test-quartz
,test-app
:If run with
--spring.profiles.active=test
, Spring-Boot should also loadbase-db
,base-quartz
,base-app
,test-db
,test-quartz
,test-app
too, am i right?The text was updated successfully, but these errors were encountered: