Skip to content

Problem when including spring profiles with logical operators #16303

@bondj

Description

@bondj

Spring Boot v2.1.3.RELEASE

I have an application.yml where I want to include profiles based on logical conditions on what profiles are active. I've attached my application.yml

---
spring.profiles: a & b
spring:
  profiles:
    include:
      - includeAandB
mypropAandB: valueAandB

---
spring.profiles: a
spring:
  profiles:
    include:
      - includeA
mypropA: valueA
---
spring.profiles: b
spring:
  profiles:
    include:
      - includeB
mypropB: valueB

---
spring.profiles: c
spring:
  profiles:
    include:
      - includeC
mypropC: valueC

When I run

SPRING_PROFILES_ACTIVE=a,b ./gradlew bootRun

I get

The following profiles are active: a,includeA,b,includeB

This seems inconsistent, I was expecting a,includeA,b,includeB,includeAandB or possible a,b if the includes were not supported.

Metadata

Metadata

Labels

status: declinedA suggestion or change that we don't feel we should currently apply

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions