title: getClass().getResourceAsStream() in maven project
body: <p>The pom.xml of my maven project looks as follows:</p>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;groupId&lt;/groupId&gt;
    &lt;artifactId&gt;artifactId&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  
    &lt;build&gt;
     &lt;sourceDirectory&gt;src/main/java&lt;/sourceDirectory&gt;
     &lt;resources&gt;
      &lt;resource&gt;
       &lt;directory&gt;src/main/resources&lt;/directory&gt;
      &lt;/resource&gt;
     &lt;/resources&gt;
    &lt;/build&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>In the src/main/resources directory I have a file called test.
  In the src/main/java directory I have a class that contains the following line:</p>
  
  <pre><code>System.out.println(this.getClass().getResourceAsStream("test"));
  </code></pre>
  
  <p>When the line of code is run within Eclipse, I get as output </p>
  
  <pre><code>java.io.BufferedInputStream@1cd2e5f 
  </code></pre>
  
  <p>When I export the project as .jar and run it I get as output</p>
  
  <pre><code> null
  </code></pre>
  
  <p>Did I configure anything wrong?</p>