title: Get Maven basedir from a properties file in a SpringBoot project
body: <p>The Maven project I inherited has some resource files used in JUnits.<br>
  Those files are referred in a properties file as absolute paths.<br>
  Let's assume the Maven project is under <code>myproject</code>, where the main <code>pom.xml</code> resides.</p>
  
  <p>A <code>config.properties</code> file has:</p>
  
  <pre><code>keystore.file=C:/Users/tom/myproject/web/src/test/resources/myfile.jks
  </code></pre>
  
  <p>I want to refer to that resource from a relative path of the Maven project.<br>
  So I have been trying something like:</p>
  
  <pre><code>keystore.file=${project.basedir}/web/src/test/resources/myfile.jks
  </code></pre>
  
  <p>I have been reading about <a href="http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html" rel="nofollow noreferrer">resource filtering</a> which is referred in <a href="https://stackoverflow.com/questions/14763431/accessing-maven-pom-variables-from-properties-file">this question</a>.  </p>
  
  <p>The project uses SpringBoot, and when running a JUnit, complains with:</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'project.basedir' in string value "${project.basedir}/web/src/test/resources/myfile.jks"
      at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174)
  </code></pre>