title: Maven test fails with NoClassDefFoundError for ANTLR class
body: <p>I am using <code>main/resources/antlr-4.2-complete.jar</code> external library. I already included it on my classpath. But when I run test goal, inside eclipse I receive following message</p>
  
  <pre><code>Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.048 sec &lt;&lt;&lt; FAILURE!
  checkGrammar(br.com.stoneage.GrammarTest)  Time elapsed: 0.011 sec  &lt;&lt;&lt; ERROR!
  java.lang.NoClassDefFoundError: org/antlr/v4/runtime/CharStream
  </code></pre>
  
  <p>So I know that test goal is not looking for <code>antlr-4.2-complete.jar</code>. How can I solve this?</p>
  
  <p>Here is my POM file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
    &lt;groupId&gt;br.com.stoneage&lt;/groupId&gt;
    &lt;artifactId&gt;SASInterpreter&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
  
    &lt;name&gt;SASInterpreter&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
    &lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
        &lt;groupId&gt;junit&lt;/groupId&gt;
        &lt;artifactId&gt;junit&lt;/artifactId&gt;
        &lt;version&gt;4.11&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
      &lt;/dependency&gt;
  
     &lt;/dependencies&gt;
  &lt;/project&gt;
  </code></pre>