Starting Spring Application by merging yml files
<p>Is there a way in spring boot to merge properties from different config files and start the application?</p>

<p>Ex: My application-local.yml which is the one that gets used by default had following properties</p>

<pre><code>server:
  port: 8080
spring:
  profiles: local

propertyA: xxx
propertyB: yyy
</code></pre>

<p>Now instead of having to copy all the properties from the local to lets say application-QA.yml like this</p>

<pre><code>server:
  port: 8081
spring:
  profiles: local

propertyA: xxx
propertyB: zzz
</code></pre>

<p>where only port &amp; propertyB has been updated, can I just have something like below?</p>

<p>application-QA.yml:</p>

<pre><code>server:
  port: 8081
propertyB: zzz
</code></pre>

<p>At the end I want to have the following ability to start my applicatio</p>

<ul>
<li>with local - ./gradlew bootrun
 should pick up properties from application-local.yml which is what is happening now</li>
<li>with QA - ./gradlew bootrun -Dsome.property=QA
 should merge properties from local and QA and start the application</li>
</ul>

<p>Right now we have to copy port &amp; propertyB to application-local.yml and start the application in order to point to QA environment and I would like to eliminate that.</p>

<p>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.</p>