-
Notifications
You must be signed in to change notification settings - Fork 41k
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
Problem when including spring profiles with logical operators #16303
Comments
Profile expressions (and negated profiles) get processed last, i.e. once we already know the profiles activated and included by the config files. If the YAML document that's activated by a profile expression itself contains a We'd have to go over the config files again to look for documents matching the profiles included by the expression. Let's see if the rest of the team thinks this is something we should fix. |
Based on the complexity of the fix we can decide whether it should go in |
I have a fix for this here but this is turning out to get a bit complicated because of the way included profiles are supposed to be ordered. For example, look at the configuration below: spring.profiles: a
spring.profiles.include: c
---
spring.profiles: a & b
spring.profiles.include: d,e
---
spring.profiles: d
spring.profiles.include: f
--- Given that profiles |
Spring Boot 2.4 has overhauled config processing. See this blog post for details. Since the I would suggest using I'm going to close this one for now, but if you find there's an obvious use-case that we're missing from the new code then please comment back here and we can have another look. We'll need a bit more background about what's driving the need for the |
Spring Boot v2.1.3.RELEASE
I have an application.yml where I want to include profiles based on logical conditions on what profiles are active. I've attached my application.yml
When I run
I get
The following profiles are active: a,includeA,b,includeB
This seems inconsistent, I was expecting a,includeA,b,includeB,includeAandB or possible a,b if the includes were not supported.
The text was updated successfully, but these errors were encountered: