title: JUnit tests in Maven multi-module project throw NoClassDefFoundError
body: <p>Our project has the following structure:</p>
  
  <pre><code>├─ A
     ├─ A-A
     ├─ A-B
     ├─ A-C
     ├─ A-D
     ├─ A-E
     ├─ A-F
     ├─ A-G
  </code></pre>
  
  <p>The relevant JUnit tests are located in <strong>A-A</strong>. Before we were using Maven, we had to adapt the run configuration (set the working directory in the arguments tab to <strong>A-B</strong> which starts the application) in Eclipse in order to launch all tests without errors.</p>
  
  <p>Now we get a <code>NoClassDefFoundError</code> from a class located in <strong>A-A</strong> when we try to run the tests, no matter if we do that in Eclipse (Run As > JUnit Test) or with Maven (<code>mvn test</code>). I think this is different to <a href="https://stackoverflow.com/questions/13970559/maven-junit-tests-noclassdeffounderror">similar issues on Stack Overflow</a> because our tests aren't working at all.</p>
  
  <p>My guess is that we have a bad configured POM and Surefire can't find all class files or something like that. Is there a way to configure the plugin the way we did it with the run configuration before? Or is this error caused by something else (like M2Eclipse)?</p>
  
  <p><strong>EDIT:</strong> The internal structure of project <strong>A-A</strong> is as follows (<code>ClassCausingError</code> extends a class from a Maven dependency):</p>
  
  <pre><code>├─ A-A
     ├─ src/main/java
         ├─ foo/bar/ClassCausingError.java
     ├─ src/main/resources
     ├─ src/test/java
         ├─ foo/bar/ClassCausingErrorTest.java
     ├─ target
     ├─ pom.xml
  </code></pre>