Skip to content

Spring Active Profiles inconsistencies with --spring.profiles.active and SpringApplicationBuilder #342

@sstarcher

Description

@sstarcher

new SpringApplicationBuilder.profiles does not seem to be reloading correctly.
Command line --spring.profiles.active=A
new SpringApplicationBuilder.profiles("C")
version is A and ActiveProfiles are "A,C"
I would expect version to be C.

Command line --spring.profiles.active=C
new SpringApplicationBuilder.profiles("A")
version is C and ActiveProfiles are "C,A"
Works as expected and I get a version of C.

When not using --spring.profiles.active on the command line and only using the SpringApplicationBuilder setting the profile does not seem to affect the value of version when spring.profiles.active is set in the yml file.

spring.profiles.active: B

---
spring.profiles: A
version: A

---
spring.profiles: B
version: B

---
spring.profiles: C
version: C

---

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions