title: Multiple external property file in spring boot from command line
body: <p>I want to read 2 properties file from external location.
  It needs to be loaded via command line argument. </p>
  
  <ol>
  <li><p>configuration.properties - > this is a normal property file and contains public information.</p></li>
  <li><p>secure.properties  - > this contains encrypted passwords.</p></li>
  </ol>
  
  <p>I am giving following commands line parameters </p>
  
  <pre><code>-Dspring.config.location=file:C:\Project\properties\configuration.properties, file:C:\Project\properties\security\dev\secure.properties
  </code></pre>
  
  <p>The properties for <code>configuration.properties</code> are working fine. As i am not directly loading file, but rather using the property.</p>
  
  <p>Here, for this encrypted file i need to pass the path and load explicitly, which is not Happening.</p>
  
  <p>Also the util  <code>EncryptedPropertiesReader</code> is available in jar and thus can't modify it. </p>
  
  <p>Here, the catch is how i need to use the secure.properties</p>
  
  <p>We have a class <code>EncryptedPropertiesReader</code>. 
  And it contains a <code>load(string path)</code> method.</p>
  
  <p>Thus i need to pass the path of the <code>secure.properties</code> file. </p>
  
  <p>I.e.</p>
  
  <pre><code>String env = "dev" 
  Properties p = EncryptedPropertiesReader.load("security\" + env + "\secure.properties");
  System.out.println(p); // null
  </code></pre>
  
  <p>Here, i can't give the absolute path because in different environments (Unix), I'll have different path. </p>
  
  <p>Thus command line is my option and need to keep properties external too. </p>
  
  <p>Here Are combinations tried by me :</p>
  
  <hr>
  
  <ul>
  <li><p><strong>Command line :</strong></p>
  
  <ol>
  <li><p>giving classpath for the secure. Properties</p>
  
  <pre><code>-Dspring.config.location=file:C:\Project\properties\configuration.properties, classpath:C:\Project\properties\security\dev\
  </code></pre></li>
  <li><p>giving <code>spring.config.nane</code></p>
  
  <pre><code>-D spring.config.name=configuration, secure - Dspring.config.location=file:C:\Project\properties\configuration.properties, file:C:\Project\properties\security\dev\secure.properties
  </code></pre></li>
  <li><p>tried changing \ to /</p></li>
  </ol></li>
  </ul>
  
  <hr>
  
  <ul>
  <li><p><strong>path of url passed</strong></p>
  
  <ol>
  <li><p><code>("secure.properties");</code> //expected to work when i load class path</p></li>
  <li><p><code>("/secure.properties");</code> //expected to work when i load class path</p></li>
  </ol></li>
  </ul>
  
  <hr>
  
  <blockquote>
    <p>None of the above combination worked. </p>
    
    <p>Any idea what's going wrong? Or what am i missing out?</p>
    
    <p>Apologies for the long question.</p>
  </blockquote>