title: Can't access to files in resources directory with Maven (with Eclipse IDE)
body: <p>I have a problem for a couple of hours, and I tried all the solutions I've found on tutorials.
  It's simple: I can't access the resource files. I try to open a file I've put in <code>src/main/resources</code> and <code>src/test/resources</code>.</p>
  
  <p>I have a simple Java project and I use Maven, with Eclipse as IDE, with the m2e plugin.
  I want to use resources filtering with Maven, with different profiles, and there's my <code>POM.xml</code>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.3.2&lt;/version&gt;
        &lt;configuration&gt;
      &lt;source&gt;1.5&lt;/source&gt;
      &lt;target&gt;1.5&lt;/target&gt;
      &lt;debug&gt;false&lt;/debug&gt;
      &lt;optimize&gt;true&lt;/optimize&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
        &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
        &lt;version&gt;2.4&lt;/version&gt;
        &lt;configuration&gt;
      &lt;encoding&gt;UTF-8&lt;/encoding&gt;
        &lt;/configuration&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  
    &lt;filters&gt;
      &lt;filter&gt;src/main/filters/${env}.properties&lt;/filter&gt;
    &lt;/filters&gt;
  
    &lt;resources&gt;
      &lt;resource&gt;
        &lt;directory&gt;src/main/resources&lt;/directory&gt;
        &lt;filtering&gt;true&lt;/filtering&gt;
      &lt;/resource&gt;
      &lt;resource&gt;
        &lt;directory&gt;src/test/resources&lt;/directory&gt;
        &lt;filtering&gt;true&lt;/filtering&gt;
      &lt;/resource&gt;
    &lt;/resources&gt;
  &lt;/build&gt;
  
  &lt;profiles&gt;
    &lt;profile&gt;
      &lt;id&gt;LOCAL&lt;/id&gt;
      &lt;activation&gt;
        &lt;activeByDefault&gt;true&lt;/activeByDefault&gt;
      &lt;/activation&gt;
      &lt;properties&gt;
        &lt;env&gt;local&lt;/env&gt;
      &lt;/properties&gt;
        &lt;/profile&gt;
  &lt;/profiles&gt;
  </code></pre>
  
  <p>And I made a simple test, in src/java/test :</p>
  
  <pre><code>@Test
  public void testOpenResourceFile() {
      File testf=new File("/test.txt");
      assertTrue(testf.exists());
  }
  </code></pre>
  
  <p>So, in Eclipse, I run (on my project folder, in the package view) :</p>
  
  <ul>
  <li>Run as > Maven build > process-resources</li>
  <li>Run as > Maven build > process-test-ressources</li>
  <li>Run as > Maven build > compile</li>
  </ul>
  
  <p>With env: LOCAL</p>
  
  <p>In the test, I do: Run as > Junit Test Case.
  But it fail...
  I looked in target/test-classes directory generated by Maven, and the file test.txt is there.</p>
  
  <p>Did I missed some steps during my project's compilation, or is there a problem with my configuration?</p>
  
  <p>EDIT:<br>
  I tried with <code>File("test.txt")</code> and <code>File("../test.txt")</code> as well.</p>