title: Adding /src/main/resources to Classpath when Running Spring JUnit Tests from Eclipse
body: <p>Is there a way of getting JUnit tests in Eclipse (specifically I'm using <code>SpringJUnit4ClassRunner</code>) to use resources from <code>src/main/resources</code> as well as <code>src/test/resources</code>?</p>
  
  <p>Maven's surefire plugin does this, but running one particular unit test from Eclipse does not.</p>
  
  <p>I've got a load of Spring config in <code>src/main/resources/spring-config/</code> and I want to 'override' two specific files. I've placed these test-specific overrides in <code>src/test/resources/spring-config/</code>, and when running unit tests through Maven eveerything works. When I run a JUnit test from Eclipse, <em>only</em> the test files are available, and unsurprisingly my context fails to load.</p>
  
  <p><strong>Update</strong></p>
  
  <p>Is appears the Spring classes that configure the test context can't find the resources from <code>src/main/resources/</code> when using a wildcard, but <em>will</em> find them if I specify them explicitly.</p>
  
  <p><strong>Doesn't find things from <code>src/main/resources/</code></strong></p>
  
  <pre><code>@ContextConfiguration(locations = {"classpath:/spring-config/*.xml"})
  </code></pre>
  
  <p><em><strong>Does</em> find specified files from <code>src/main/resources/</code></strong></p>
  
  <pre><code>@ContextConfiguration(locations = {"classpath:/spring-config/*.xml",
                                     "classpath:/spring-config/app-aws.xml"})
  </code></pre>