title: Springboot not loading application.dev.properties file
body: <p>In my project I want to use environment specific property file. For example if I am running it into development it should use application.dev.properties, for production it should use application.prod.properties and so on.</p>
  
  <p>I have below two files in my resources folder.</p>
  
  <ol>
  <li>application.properties  (For production)</li>
  <li>application.dev.properties  (For development)</li>
  </ol>
  
  <p>I have one properties like below in each file.</p>
  
  <p>For Prod</p>
  
  <pre><code>server.database.host=192.168.1.1
  </code></pre>
  
  <p>For Dev</p>
  
  <pre><code>server.database.host=192.168.12.125 
  </code></pre>
  
  <p>And I have a class like below</p>
  
  <pre><code> public class DataSource {
  
       @Value(${server.database.host})
       String host;
  </code></pre>
  
  <p>The above code always takes prod setting (application.properties) file even though I supply proper argument for dev like <code>--spring.profiles.active=dev</code></p>
  
  <p>Below is the command I am using to load the dev properties file.</p>
  
  <pre><code>java -jar myjar.jar --spring.profiles.active=dev
  </code></pre>
  
  <p>It also prints that active profile is dev but it always connect to prod db.</p>