Skip to content

spring.profiles.include overrides other profiles being activate #25712

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

Closed
cdprete opened this issue Mar 17, 2021 · 8 comments
Closed

spring.profiles.include overrides other profiles being activate #25712

cdprete opened this issue Mar 17, 2021 · 8 comments
Assignees
Labels
status: superseded An issue that has been superseded by another

Comments

@cdprete
Copy link

cdprete commented Mar 17, 2021

Hi.
In my Spring Boot 2.4.3 application I've the following YAML configuration in the application.yml file:

spring.profiles.include: native
spring.profiles.group.default: demo-data,dev

As a result, I now get just the native profile as being activated.
This was not the case with Spring Boot 2.1.2 where I had:

  • in the application.yml file:
spring.profiles.include: native
  • in the application-default.yml file:
spring.profiles.active: demo-data,dev

and, as a result, all of them where activated.

Is there a way to get the old behaviour back?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 17, 2021
@wilkinsona
Copy link
Member

Is there a way to get the old behaviour back?

If you set spring.config.use-legacy-processing=true, you can continue to use your old arrangement with spring.profiles.include and spring.profiles.active.

@cdprete
Copy link
Author

cdprete commented Mar 17, 2021

I read about it, but I would like to avoid it since it could be dropped.

@philwebb
Copy link
Member

I'm actually quite surprised that native, demo-data and dev were all activated with earlier versions of Spring Boot. It seems a little confusing to me that the default profile isn't active but the ones it includes are.

Can you describe your setup a little more? What's the purpose of the demo-dev and dev profiles and when you expect them to be active/inactive? Could they be moved into spring.profiles.include? I.e. spring.profiles.include: native, demo-dev, dev?

@philwebb philwebb added the status: waiting-for-feedback We need additional information before we can continue label Mar 17, 2021
@cdprete
Copy link
Author

cdprete commented Mar 18, 2021

@philwebb dev provides configurations for local development (e.g., use basic authentication rather then JWT authentication) and demo-data enables the generation of demo data, if needed.
While developing we usually want those profiles to be enabled and we don't specify any specific profile to be activated, but we don't want them in production and therefore I cannot put them in the include and activate them unconditionally.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Mar 18, 2021
@philwebb
Copy link
Member

@cdprete If I understand you correctly, you want to run an app on a developer machine without any profiles active and get native, dev and demo-data? Then when you move it into production you want to just get native? Do you activate some additional profile when running in production?

@philwebb philwebb added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Mar 22, 2021
@cdprete
Copy link
Author

cdprete commented Mar 23, 2021

@philwebb you got the point for the DEV setup and, to answer to your question, yes we do enable other profiles in production (not demo-data and dev of course).
So, in production I would like to have the native profile active plus the others that we specify through the OPTS.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Mar 23, 2021
@philwebb philwebb self-assigned this Apr 6, 2021
@philwebb
Copy link
Member

Apologies for letting this one slip though the net. Since the issue is a few years old, I assume you've found some other way of fixing it. I've opened #42066 to investigate a general purpose solution for developer specific profile/settings.

@philwebb philwebb closed this as not planned Won't fix, can't repro, duplicate, stale Aug 30, 2024
@philwebb philwebb added status: superseded An issue that has been superseded by another and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Aug 30, 2024
@cdprete
Copy link
Author

cdprete commented Sep 1, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another
Projects
None yet
Development

No branches or pull requests

4 participants