title: Classpath trouble using JUnit with both Eclipse and Maven
body: <p>In a JUnit test I'm using this code to load in a test-specific config file:</p>
  
  <pre><code>InputStream configFile = getClass().getResourceAsStream("config.xml");
  </code></pre>
  
  <p>When I run the test through eclipse, it requires the xml file to be in the same directory as the test file.</p>
  
  <p>When I build the project with maven, it requires the xml to be in <code>src/test/resources</code>, so that it gets copied into <code>target/test-classes</code>.</p>
  
  <p>How can I make them both work with just one file?</p>