title: how to make maven use test resources
body: <p>when I use the command: mvn test, maven uses the main resources instead of the test ones in src/test/resources.</p>
  
  <p>How can i make maven use the test resources rather than the main resources?</p>
  
  <p>EDIT: I use Classloader to find my resources. Classloader can find resources from my src/test/resources directory, but it looks in src/main/java first for the resource.</p>
  
  <pre><code>ClassLoader loader = Thread.currentThread().getContextClassLoader();
  InputStream file =loader.getResourceAsStream("resource.xml");
  </code></pre>
  
  <p>Or is there any property I can use while running a maven command that will prioritize a classpath?</p>
  
  <p>EDIT 2: I have figured out the problem, it does load from test/resources for the test, however my test involves deploying a webapp (integration testing) and from there when the webapp accesses the resource it uses src/main/resources. Is there a way to change the order of the classpath or make one precede the other for a WAR deployed in a jetty container?</p>