-
Notifications
You must be signed in to change notification settings - Fork 41.2k
additionalProfiles overwrites spring.profiles.default #43157
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
Comments
I believe this is the correct behavior. Default profiles are used only when no active profiles are specified. In your example, you added You can use System.setProperty(AbstractEnvironment.ACTIVE_PROFILES_PROPERTY_NAME, "mongo");
|
This is correct. Documentation for that is here: https://docs.spring.io/spring-framework/reference/core/beans/environment.html#beans-definition-profiles-default
|
I was thinking of I cannot use active profiles, since we set |
They're added on top of active/included profiles but not added on top of default profiles. Perhaps you might be able to use Failing that, you could use an |
Yes good hint, maybe I should implement EnvironmentPostProcessor, feels a little bit wired to need that for such a simple case, but maybe it is the easiest right now. |
Uh oh!
There was an error while loading. Please reload this page.
I would like to be able to do something like this:
My expectation was that this comes up with
mongo
,default-values
but it comes up withdefault-values
only.This makes default profiles & additional profiles unusable together.
(I guess #24688 could offer an overall nicer solution for my initial problem, but until then...)
The text was updated successfully, but these errors were encountered: