title: loading spring-{env}.properties in IntelliJ 2016.3
body: <p>I have a Spring Boot properties with three properties files:
  <a href="https://i.stack.imgur.com/7LH9f.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7LH9f.png" alt="enter image description here"></a></p>
  
  <p>I have a class that uses values defined in application-local.properties file, which I thought would get used because application-properties has `spring.profiles.active=local</p>
  
  <p>When I start up in IntelliJ, I see this in the console logs:</p>
  
  <pre><code>Loaded config file 'file:.../build/resources/main/application.properties' (classpath:/application.properties)
  2016-12-18 20:10:17.596 DEBUG 29999 --- [  restartedMain] o.s.b.c.c.ConfigFileApplicationListener  : Loaded config file 'file:.../build/resources/main/application-local.properties' (classpath:/application-local.properties)`
  Skipped (empty) config file 'file:...build/resources/main/application-local.properties' (classpath:/application-local.properties) for profile local
  </code></pre>
  
  <p>It says it skipped the empty config file, but when I inspect 'build/resources/main/application-local.properties' then I see the values in there.</p>
  
  <p>However, the following class does not have the properties when I run it from within IntelliJ as a Spring Boot Application. It throws a null pointer because these are null:</p>
  
  <pre><code>@Value("${myapp.ApiKey}")
  private String apiKey;
  
  @Value("${myapp.ApiSecret}")
  private String apiSecret;
  
  @Value("${myapp.user}")
  private String user;
  </code></pre>
  
  <p>In the Application Configuration I tried using Active Profiles, Program Arguments, and Environment Variables.</p>
  
  <p>However, if I run from the command line as:</p>
  
  <pre><code>java -jar -Dspring.active.profiles=local  build/libs/myjar-0.0.1-SNAPSHOT.jar
  </code></pre>
  
  <p>then it works just fine. I am sure this was working previously, but not sure if the IntelliJ version was the same.  Any tips on how to make the correct version of my application.properties get used?</p>