title: Maven Shade External Properties file relative to final Jar
body: <p><strong>Hi all!!</strong></p>
  
  <p>Sorry if this is a dumb question, but I'm new to Maven and have reached an impasse!</p>
  
  <ol>
  <li>I have a project which uses MyTest.properties, MoreMyTest.properties.</li>
  <li>I use the Maven Shade plugin to build this project into a .jar file, which is working fine! Unfortunately, the shade plugin is packaging MyTest.properties inside my jar file.</li>
  </ol>
  
  <p>Then, I get this error when I try to execute the jar.</p>
  
  <blockquote>
    <p>java.io.FileNotFoundException: Unable to locate: properties/MyTest.properties at file:\C:\Dev\test.jar!\properties\MyTest.properties
                at ...</p>
  </blockquote>
  
  <p>I'm wanting to access my properties both inside my IDE, and by running the jar from the command line when I deploy. I was thinking of having my properties files in a relative folder ../lib/ above the location of my jar file. </p>
  
  <p>Inside my program I want to access the properties like so:</p>
  
  <pre><code>File testProperties = new File(
    ClassLoader.getSystemResource("properties/MyTest.properties").getFile()
  );
  </code></pre>
  
  <p>I tried adding this to my POM.xml</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;transformer
      implementation="org.apache.maven.plugins.shade.resource.IncludeResourceTransformer"&gt;
    &lt;resource&gt;*.properties&lt;/resource&gt;
    &lt;file&gt;../*properties&lt;/file&gt;
  &lt;/transformer&gt;
  </code></pre>
  
  <p>(Sorry the formatting got messed on the above code snippet!)</p>
  
  <p>But, it's not working. I'd really appreciate any help in this. I've not posted all code as the code is really big, but I hope you can get an idea of what I'm trying to achieve. </p>
  
  <p>Many thanks,
  Paul</p>