title: Spring Boot + Spring Cloud Config - How to add more profiles from the Git external configuration
body: <p>I have this configuration in a spring boot application:</p>
  
  <pre><code>spring:
    application:
      name: my-app
    profiles:
      active: ${ENVIRONMENT}
    cloud:
      config:
       uri: http://localhost:8888
  </code></pre>
  
  <p>My config server reads the following files:</p>
  
  <p><strong>my-app-dev.yaml</strong></p>
  
  <pre><code>prop: dev property
  </code></pre>
  
  <p><strong>my-app-pro.yaml</strong></p>
  
  <pre><code>prop: pro property.
  </code></pre>
  
  <p>I launch the spring boot app setting <code>-DENVIRONMENT=dev</code>, loading correctly the dev external Git properties.</p>
  
  <p>When I inject the Environment in let's say a controller and do <code>env.getActiveProfiles()</code> I get "dev" as expected.</p>
  
  <p>I would like to add more profiles from the git configuration. For instance:</p>
  
  <p><strong>my-app-dev.yaml</strong></p>
  
  <pre><code>prop: dev property
  spring:
    active:
      profiles: dev,business1
  </code></pre>
  
  <p><strong>my-app-pro.yaml</strong></p>
  
  <pre><code>prop: dev property
  spring:
    active:
      profiles: pro,business2
  </code></pre>
  
  <p>So that <code>env.getActiveProfiles()</code> returns <code>["dev","business1"]</code>. However what it returns is the initial <code>"dev"</code>.</p>
  
  <p>How could this be done?</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>As suggested by Dave Syer I tried using <code>spring.profiles.include</code> in the Git files but the new profiles aren't added to the Environment: </p>
  
  <p><strong>my-app-dev.yaml</strong></p>
  
  <pre><code>prop: dev property
  spring:
    profiles:
      include: business1
  </code></pre>
  
  <p><strong>my-app-pro.yaml</strong></p>
  
  <pre><code>prop: dev property
  spring:
    profiles:
      include: business2
  </code></pre>
  
  <p><code>environment.getActiveProfiles() ---&gt; "dev"</code></p>