-
Notifications
You must be signed in to change notification settings - Fork 40.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SpringApplication.setAdditionalProfiles, application-XXX.yml and SpringBoot2.4 #25704
Labels
Comments
spring-projects-issues
added
the
status: waiting-for-triage
An issue we've not yet triaged
label
Mar 16, 2021
philwebb
added
type: bug
A general bug
and removed
status: waiting-for-triage
An issue we've not yet triaged
labels
Mar 23, 2021
nguyensach
added a commit
to nguyensach/spring-boot
that referenced
this issue
Mar 29, 2021
Add additional profiles which is set via programmatically, to Spring's environment property sources when legacy processing is used This commit updates the following areas: - Add additionalProfiles field to ConfigFileApplicationListener to pass SpringApplication 's addition profiles which is set via programmatically, to ConfigFileApplicationListener from ConfigDataEnvironmentPostProcessor - Add additional profiles into Spring's environment property sources - Supplement unit test for SpringApplicationTests Closes spring-projects#25704
nguyensach
added a commit
to nguyensach/spring-boot
that referenced
this issue
Mar 29, 2021
Add additional profiles which are set by programmatically, to Spring's environment property sources when legacy processing is used This commit updates the following areas: - Add additionalProfiles field to ConfigFileApplicationListener to pass SpringApplication's addition profiles which are set by programmatically, to ConfigFileApplicationListener from ConfigDataEnvironmentPostProcessor - Add additional profiles into Spring's environment property sources - Supplement unit test for SpringApplicationTests Closes spring-projects#25704
nguyensach
added a commit
to nguyensach/spring-boot
that referenced
this issue
Mar 29, 2021
Add additional profiles which are set by programmatically, to Spring's environment property sources when legacy processing is used This commit updates the following areas: - Add additionalProfiles field to ConfigFileApplicationListener to pass SpringApplication's addition profiles which are set by programmatically, to ConfigFileApplicationListener from ConfigDataEnvironmentPostProcessor - Add additional profiles into Spring's environment property sources - Supplement unit test for SpringApplicationTests Closes spring-projects#25704
nguyensach
added a commit
to nguyensach/spring-boot
that referenced
this issue
Mar 30, 2021
In post-processing the given environment of ConfigDataEnvironmentPostProcessor, add SpringApplication's additional profiles that are set by programmatically into environment when legacy processing is used. This commit updates the following areas: - Add configureAdditionalProfiles method into ConfigDataEnvironmentPostProcessor, that add the additional profiles into the given environment. - When legacy processing is used, call configureAdditionalProfiles method to add the additional profiles into the given environment. - Remove unnecessary configureAdditionalProfiles method in SpringApplication. - Supplement unit test for SpringApplicationTests. Closes spring-projects#25704
nguyensach
added a commit
to nguyensach/spring-boot
that referenced
this issue
Mar 30, 2021
In post-processing the given environment of ConfigDataEnvironmentPostProcessor, add SpringApplication's additional profiles that are set by programmatically into environment when legacy processing is used. This commit updates the following areas: - Add configureAdditionalProfiles method into ConfigDataEnvironmentPostProcessor, that add the additional profiles into the given environment. - When legacy processing is used, call configureAdditionalProfiles method to add the additional profiles into the given environment. - Remove unnecessary configureAdditionalProfiles method in SpringApplication. - Supplement unit test for SpringApplicationTests. Closes spring-projects#25704
This comment has been minimized.
This comment has been minimized.
Closing in favor of PR #25817. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
I consider a
SpringApplication
computing profiles on the fly, to be activated throughSpringApplication.setAdditionalProfiles
I used this up to SprintBoot 2.3 to activate configuration in
application-XXX.yml
filesWith SpringBoot 2.4, this seems not functional anymore, even with
Here is a snippet of code demonstrating the issue:
application-reproduce.yml:
In SpringBoot 2.3, I see twice
BEWARE: anything
: OKIn SpringBoot 2.4, I see:
which demonstrate explicit profiles definition is OK, but simply exposing them through
.setAdditionalProfiles
lead them not taken in account forapplication-XXX.yml
property sources.The text was updated successfully, but these errors were encountered: