title: Why Jenkins fails to load the resources?
body: <p>Here is the layout of my project:</p>
  
  <pre><code>src/
    test/
      resources/
          ares/
            file1.xml
            file2.xml
  </code></pre>
  
  <p>Here is the layout of the Jenkins workspace:</p>
  
  <pre><code> my-module/
     target/
       test-classes/
         ares/
           file1.xml
           file2.xml
  </code></pre>
  
  <p>Under eclipse the tests run without any error.
  On Jenkins, the tests just fail. Jenkins is unable to locate the resources.
  Below are some output from the test execution:</p>
  
  <h3>Eclipse</h3>
  
  <pre><code>MyClass.class.getResourceAsStream(/ares/file1.xml) =&gt; java.io.BufferedInputStream@4f4b2f1a
  MyClass.class.getResourceAsStream(ares/file1.xml) =&gt; null
  
  Thread.currentThread().getContextClassLoader().getResourceAsStream(/ares/file1.xml) =&gt; null
  Thread.currentThread().getContextClassLoader().getResourceAsStream(ares/file1.xml) =&gt; java.io.BufferedInputStream@5d402eeb
  
  MyClass.class.getClassLoader().getResourceAsStream(/ares/file1.xml) =&gt; null
  MyClass.class.getClassLoader().getResourceAsStream(ares/file1.xml) =&gt; java.io.BufferedInputStream@20c87621
  </code></pre>
  
  <h3>Jenkins</h3>
  
  <pre><code>MyClass.class.getResourceAsStream(/ares/file1.xml) =&gt; null
  MyClass.class.getResourceAsStream(ares/file1.xml) =&gt; null
  
  Thread.currentThread().getContextClassLoader().getResourceAsStream(/ares/file1.xml) =&gt; null
  Thread.currentThread().getContextClassLoader().getResourceAsStream(ares/file1.xml) =&gt; null
  
  MyClass.class.getClassLoader().getResourceAsStream(/ares/file1.xml) =&gt; null
  MyClass.class.getClassLoader().getResourceAsStream(ares/file1.xml) =&gt; null
  </code></pre>
  
  <p>As you can see Jenkins doesn't find my resource.</p>
  
  <p>What am I missing?</p>