Skip to content

How to load sub yml config file use spring.profiles.group property? #24309

@blling

Description

@blling

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

spring:
  profiles:
    group:
      - base-db
      - base-quartz
      - base-app

main resource:
image

application-test.yml

spring:
  profiles:
    group:
      - test-db
      - test-quartz
      - test-app

test resource:
image

log shows Spring-Boot only load application.yml and application-test.yml, but no base-db, base-quartz, base-app,test-db, test-quartz, test-app

2020-12-02 13:22:07.463 TRACE  [main] org.springframework.boot.context.config.ConfigDataEnvironment Adding imported property source 'Config resource 'classpath:/application-test.yml' via location 'optional:classpath:/''
2020-12-02 13:22:07.463 TRACE  [main] org.springframework.boot.context.config.ConfigDataEnvironment Adding imported property source 'Config resource 'classpath:/application.yml' via location 'optional:classpath:/''

If run with --spring.profiles.active=test, Spring-Boot should also load base-db, base-quartz, base-app,test-db, test-quartz, test-app too, am i right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: stackoverflowA question that's better suited to stackoverflow.com

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions