title: Executeable jar with maven to contain ressources
body: <p>I have a problem with building an executable jar using maven it create a jar but I can't open it because it doesn't find my file, and I don't know what to do anymore
  I am using this for loading a file, if I add an absolute path to file it works great</p>
  
  <pre><code>ClassLoader classLoader = SelectionLab.class.getClassLoader();
  File file = new File(classLoader.getResource("Opstine.shp").getFile());
  if (file == null) {
          return;
  }
  </code></pre>
  
  <p>and here is part of my pom.xml</p>
  
  <pre><code>    &lt;build&gt;  
       &lt;plugins&gt;  
         &lt;plugin&gt;  
           &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;  
           &lt;configuration&gt;  
             &lt;archive&gt;  
               &lt;manifest&gt;  
                 &lt;mainClass&gt;geotools.SelectionLab&lt;/mainClass&gt;  
               &lt;/manifest&gt;  
             &lt;/archive&gt;  
             &lt;descriptorRefs&gt;  
               &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;  
             &lt;/descriptorRefs&gt;  
           &lt;/configuration&gt;  
           &lt;executions&gt;  
             &lt;execution&gt;  
               &lt;id&gt;make-assembly&lt;/id&gt;  
               &lt;phase&gt;package&lt;/phase&gt;  
               &lt;goals&gt;  
                 &lt;goal&gt;single&lt;/goal&gt;  
               &lt;/goals&gt;  
             &lt;/execution&gt;  
           &lt;/executions&gt;  
         &lt;/plugin&gt;  
         &lt;plugin&gt;  
           &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;  
           &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;  
           &lt;inherited&gt;true&lt;/inherited&gt;  
           &lt;configuration&gt;  
             &lt;source&gt;1.8&lt;/source&gt;  
             &lt;target&gt;1.8&lt;/target&gt;  
           &lt;/configuration&gt;  
         &lt;/plugin&gt;    
       &lt;/plugins&gt;  
     &lt;/build&gt;  
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/gH6l9.png" alt="image"></p>
  
  <p>I tried to get absolute path as messagepane and after exporting shapefile I get this
  <img src="https://i.stack.imgur.com/a1ggi.png" alt="enter image description here">
  but I am not sure is it searching for file in jar on path F:\workspace\osma_grupa\osma_grupa\target\osma_grupa-0.0.1-SNAPSHOT-jar-with-dependencies.jar
  or it use also this part before file:. I just checked and there is file in root of jar</p>