-
Notifications
You must be signed in to change notification settings - Fork 731
Add application listener to locate property sources during bootstrap #1228
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
Changes from all commits
296453f
e6df995
53b3bf6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -294,6 +294,13 @@ private void apply(ConfigurableApplicationContext context, SpringApplication app | |
| target.addAll(getOrderedBeansOfType(context, ApplicationContextInitializer.class)); | ||
| application.setInitializers(target); | ||
| addBootstrapDecryptInitializer(application); | ||
|
|
||
| // Get the active profiles from the bootstrap context and set them in main | ||
| // application | ||
| // environment. This allows any profiles activated during bootstrap to be | ||
| // activated when | ||
| // config data runs in the main application context. | ||
| environment.setActiveProfiles(context.getEnvironment().getActiveProfiles()); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @ryanjbaxter Is it possible to bind configurations like spring.main and spring.banner within this code segment? These configurations work when loaded through ConfigDataEnvironmentPostProcessor, but they do not take effect when loaded through BootstrapApplicationListener. It appears that the issue might be because PropertySourceBootstrapConfiguration is actually executed in the main context's initializer. |
||
| } | ||
|
|
||
| @SuppressWarnings("unchecked") | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.