title: Maven JAR - class not found exception
body: <p>I created a maven war project and added javaEE API and openCSV.
  in eclipse I can see both jars, import classes and use them without any compilation errors. </p>
  
  <p>but when I run the app using tomcat and trying to save a CSV file I get this exception:</p>
  
  <pre><code>java.lang.NoClassDefFoundError: au/com/bytecode/opencsv/CSVWriter
  </code></pre>
  
  <p>JavaEE api works fine.</p>
  
  <p>I tryed to add compile but it didn't do any good.</p>
  
  <p>this is my pom:</p>
  
  <pre><code>&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  &lt;groupId&gt;com.training&lt;/groupId&gt;
  &lt;artifactId&gt;DevProject&lt;/artifactId&gt;
  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
  &lt;packaging&gt;war&lt;/packaging&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;javax&lt;/groupId&gt;
          &lt;artifactId&gt;javaee-api&lt;/artifactId&gt;
          &lt;version&gt;7.0&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;net.sf.opencsv&lt;/groupId&gt;
          &lt;artifactId&gt;opencsv&lt;/artifactId&gt;
          &lt;version&gt;2.3&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
              &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
              &lt;version&gt;3.1&lt;/version&gt;
              &lt;configuration&gt;
                  &lt;source&gt;1.6&lt;/source&gt;
                  &lt;target&gt;1.6&lt;/target&gt;
              &lt;/configuration&gt;
          &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>This is the code that throws the exception:
  CSVWriter writer = new CSVWriter(new FileWriter("file.csv"));</p>
  
  <p>Any ideas?</p>