title: Running tests using maven displays classpath problems
body: <p>I am attempting to run some unit tests on my spring web app using Maven. The app installs and runs fine without tests. </p>
  
  <p>I receive this error in my surefire test report :</p>
  
  <pre><code>java.lang.NoClassDefFoundError: javax/servlet/ServletException
  </code></pre>
  
  <p>The test itself looks like this  : </p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @ContextConfiguration(locations={"file:C:/myProjects/myWebapp/src/main/webapp/WEB-INF/applicationContext-test.xml"})
  @Transactional
  public class MyTest {
  ...
  </code></pre>
  
  <p>Previously I was receiving this <a href="https://stackoverflow.com/questions/7402144/configuration-problem-spring-security-web-classes-are-not-available-you-need-th">error</a>, however I removed any reference to the security package from test app context. And got this latest error.</p>
  
  <p>Both problems are caused by my classpath not being set correctly ? The maven dependencies do not seem to be included when testing ?  How can I change this, or what else am I missing ?</p>