title: Test-resources of dependencies not in classpath?
body: <p>I have a multi module Spring project that I set up using Maven:</p>
  
  <pre><code>my-root (pom)
      - my-logic
      - my-webapp (depending on my-logic)
      - my-consoleapp (depending on my-logic)
  </code></pre>
  
  <p>My Test classes inherit from <code>AbstractTransactionalJUnit4SpringContextTests</code> and use <code>@ContextCofiguration</code> for setting up the <code>ApplicationContext</code>.</p>
  
  <p>E.g. the test class for a Spring Controller:</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(locations = { 
    "classpath:applicationContext-logic-test.xml",
    "classpath:applicationContext-web-test.xml"})
  public class ControllerTest extends AbstractTransactionalJUnit4SpringContextTests {
  
    @Autowired
      private ApplicationContext applicationContext;
      ...
  }
  </code></pre>
  
  <p>As you can see there is a config XML per module. I have seperate configs for tesing, residing in test/resources of each module (and additionaly having the suffix "-test").   This all works (the class compiles, runs and the JUnit tests are successful) <strong>if</strong> I run the JUnit test in Eclipse.</p>
  
  <p>Now to my problem: <strong>Running the test using Maven will NOT work!</strong> (e.g. with "Run As">"Maven install" on <code>my-root</code> (I use m2eclipse)). Specifically, it will throw the following exception:</p>
  
  <blockquote>
    <p>java.io.FileNotFoundException: class path resource [applicationContext-logic-test.xml] cannot be opened because it does not exist`</p>
  </blockquote>
  
  <p>It seems that Maven does not add the files from <code>my-logic/src/test/resources</code> to the classpath that is set up when running the unit tests of <code>my-webapp</code>.</p>
  
  <p>How can I fix that?</p>