Is there a way in spring boot to merge properties from different config files and start the application?
Ex: My application-local.yml which is the one that gets used by default had following properties
server:
port: 8080
spring:
profiles: local
propertyA: xxx
propertyB: yyy
Now instead of having to copy all the properties from the local to lets say application-QA.yml like this
server:
port: 8081
spring:
profiles: local
propertyA: xxx
propertyB: zzz
where only port & propertyB has been updated, can I just have something like below?
application-QA.yml:
server:
port: 8081
propertyB: zzz
At the end I want to have the following ability to start my applicatio
- with local - ./gradlew bootrun should pick up properties from application-local.yml which is what is happening now
- with QA - ./gradlew bootrun -Dsome.property=QA should merge properties from local and QA and start the application
Right now we have to copy port & propertyB to application-local.yml and start the application in order to point to QA environment and I would like to eliminate that.
Note: ./gradlew bootrun -Dspring.profiles.active=QA doesn't seem to work for me since I will need all the properties in application-local.yml to be in application-QA.yml and not just the properties I want to override.