title: How to access application-{profile}.properties file based on active profile
body: <p>I have a requirement of accessing application.properties file outside the project location. I am able to achieve the same using following :</p>
  
  <pre><code>@Component
  @PropertySources({
          @PropertySource(value = "file:${user.home}/file/path/application.properties", ignoreResourceNotFound = false) })
  public class PropConfig implements InitializingBean {
  
  </code></pre>
  
  <p>Now, I want to achieve the same using active profile. If dev profile is active, I need to fetch application-dev.properties, if stage profile is active, I want to fetch application-stage.properties and so on.</p>
  
  <blockquote>
    <p>I am using Windows platform and JAVA 8 with Spring Boot 1.5.x</p>
  </blockquote>
  
  <p>I tried setting the active profile in application.properties file. But it doesn't work</p>
  
  <pre><code>spring.profiles.active=dev
  </code></pre>