The pom.xml of my maven project looks as follows:

<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">
  <modelVersion>4.0.0</modelVersion>
  <groupId>groupId</groupId>
  <artifactId>artifactId</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <build>
   <sourceDirectory>src/main/java</sourceDirectory>
   <resources>
    <resource>
     <directory>src/main/resources</directory>
    </resource>
   </resources>
  </build>
</project>

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:

System.out.println(this.getClass().getResourceAsStream("test"));

When the line of code is run within Eclipse, I get as output

java.io.BufferedInputStream@1cd2e5f 

When I export the project as .jar and run it I get as output

 null

Did I configure anything wrong?

Edit
Report