title: Spring Boot 2: Using external Property-Files
body: <p>I have a executeable jar what I want to configure by properties outside of the jar. What works fine is <code>application.properties</code>, when putting it to <code>config</code> folder close to the jar. But I have a second property-file what seems not to be picked up and I would like to have the best practice for that.</p>
  
  <p>The folder <code>config</code> looks like:
  <a href="https://i.stack.imgur.com/7i1Ni.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7i1Ni.png" alt="enter image description here"></a></p>
  
  <p>In the config-folder you will find:
  <a href="https://i.stack.imgur.com/h8khi.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h8khi.png" alt="enter image description here"></a></p>
  
  <p>Both property-files are also in the <code>src/main/resources</code> folder.</p>
  
  <p>My StartClass looks like:</p>
  
  <pre><code>@SpringBootApplication
  @PropertySource("migration-shrink.properties")
  public class MigrationShrinkApplication implements CommandLineRunner {}
  </code></pre>
  
  <p>My bat file looks like:</p>
  
  <pre><code>java -jar migration-shrink-0.0.1-SNAPSHOT.jar -Dspring.config.location=./config/migration-shrink.properties
  </code></pre>
  
  <p>I wanted to separate Spring-Configuration from Application-Configuration, thats why I have two different property-files.</p>
  
  <p>Thank you!</p>