Skip to content

Conditional documents in profile specific file are not loaded consistently #11109

Closed
@LProemer

Description

@LProemer

I've following problem.

I've an instance with following active profiles:
dev, test, foo

and apllication-test.yaml file

---
my.prop1: default
my.prop2: default
---
spring.profiles: dev
my.
    prop1: dev
    prop3: abc
---
spring.profiles: foo
my.prop2: foo

My intuition would tell me:
my.prop1 = dev
my.prop2 = foo

Thought the result is really:
my.prop1 = default
my.prop2 = foo

It seems to use the order of profiles, rather then the order of the document.
This seems to be different then what the documentation is saying.
(Correct me if I'm wrong)

Further more my.prop3 seems to be not set at all as if this section is ignored even if dev is set active.

Is this a bug of Spring or is there a trick to it?

lG
Lukas

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions