spring-cloud / spring-cloud-commons

Common classes used in different Spring Cloud implementations
Apache License 2.0
701 stars 697 forks source link

Unable to override local configurations using -Dspring.profiles.active=pre on SpringCloud version 2021.0.8. #1317

Closed Iamdouding closed 7 months ago

Iamdouding commented 7 months ago

spring-cloud-dependencies version 2021.0.8.

Problem Description: I specified the Spring configuration in bootstrap.yml as follows:

spring:
  profiles:
    active: dev

At the same time, I overrode it during startup using -Dspring.profiles.active=pre. However, when using the Spring Cloud Dependencies version 2021.0.8, the active profile is not overridden correctly. Instead, it outputs the following information: "The following 2 profiles are active: "pre", "dev".

springBoot version is 2.6.15

ryanjbaxter commented 7 months ago

Can you try Spring Cloud 2022.0.4 and see if there is the same behavior?

Iamdouding commented 7 months ago

I did not use the 2022.0.4 version, but trying with version 2021.0.7 worked. My solution was to change the configuration from:

spring:
  profiles:
    active: dev

to:

spring:
  profiles:
    default: dev
OlgaMaciaszek commented 7 months ago

Hello, @Iamdouding, as you can see in the project maintenance site, the only version currently in OSS support is 4.1.x (2023.0.x release train). Please let us know if the issue is still present on 2023.0.0.

spring-cloud-issues commented 7 months ago

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues commented 7 months ago

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.