title: SPRING MVC - Use an external file as @PropertySource
body: <p>I was wondering how to use an external file to load some properties for my app in different contexts..</p>
  
  <p>I know I can pass a file in <code>PropertySource</code> annotation. The problem is the path of the file.</p>
  
  <p>I mean, it looks like it want a full path to the file, but different environments have different paths for <code>Tomcat</code> directory.</p>
  
  <p><strong>My question is:</strong>
  Where is the correct directory to store this files (it must be outside to the app dir otherwise on every deploy it is deleted) and how I can link it in my application.</p>
  
  <p>For instance, now i created a <code>/config</code> directory inside the <code>/webapps</code> directory of tomcat.</p>
  
  <p><strong>From my Mac i can load the file in this way:</strong></p>
  
  <pre><code>@PropertySource("file:/Library/Tomcat/webapps/config/db.properties" )
  </code></pre>
  
  <p>but my production application is on a Linux server and obviously the path is different...</p>
  
  <p>Any idea or, better, a best practice ti manage it?</p>
  
  <p>Thanks</p>