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.ymlfile:
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?
Comment From: wilkinsona
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.
Comment From: cdprete
I read about it, but I would like to avoid it since it could be dropped.
Comment From: philwebb
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?
Comment From: cdprete
@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.
Comment From: philwebb
@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?
Comment From: cdprete
@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.
Comment From: philwebb
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.
Comment From: cdprete
Hi.
I don't work anymore for the company where I spotted this issue, so I can't say if a workout was found in the meantime.
Il ven 30 ago 2024, 19:43 Phil Webb @.***> ha scritto:
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 https://github.com/spring-projects/spring-boot/issues/42066 to investigate a general purpose solution for developer specific profile/settings.
— Reply to this email directly, view it on GitHub https://github.com/spring-projects/spring-boot/issues/25712#issuecomment-2322048256, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACAZGWARJXQIWF7RZMJJNB3ZUCVKRAVCNFSM6AAAAABNM4QAYCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRSGA2DQMRVGY . You are receiving this because you were mentioned.Message ID: @.***>