Description
After being asked in #15598 to create yet another issue I am happy to do so.
Summary
I have 2 profiles with different values for properties, e.g. dev and local.
The dev properties are the properties used for our development deployment, the local properties is my local version with some tweaks to not interfere with our DEV stage.
I want to have most of the properties in "dev", but then want to override some of these properties, eg. using my local database instead of the deployed one.
so I thought I can achieve this by using spring.profiles.include
. But this is not the case, if I use this property, all I get is the dev profiles properties.
in addition you can also see that behaviour in the log, as there is the line
The following profiles are active: local,dev
I expected to see The following profiles are active: dev, local
So what I now need to do is either to add the dev profile in my startup of the service (which is very annoying if you want to use the profile now and then not all the time, in the properties file you can just comment in/out what you need) OR copy/paste all the properties I need from dev to local (which is in my opinion an unnecessary inconvenience).
Steps to reproduce
- check out my sample project I created using the spring-boot initialiser
- run
./gradlew bootRun --args='--spring.profiles.active=local'
-> there is a log about the order of the profiles and another log to show that the valuedev.overrides.local
is true as marked in the dev profile, although the local profile says false
Using ./gradlew bootRun --args='--spring.profiles.active=dev,local-without-dev'
you can see the behaviour I would expect using the include property.