title: Maven compilation failes (but compilation under Eclipse is successful)
body: <p>While building my web project from <strong>Eclipse</strong>, everything is fine: <strong>no errors, no warnings</strong>. </p>
  
  <p>However while building project with <strong>Maven</strong> it <strong>failes</strong>. Below is the output form <code>mvn compile</code>:</p>
  
  <blockquote>
    <p>c:\Users\jwa\Desktop\tets\traffic_web>mvn
    compile -e
    + Error stacktraces are turned on. [INFO] Scanning for projects... [INFO]
    ------------------------------------------------------------------------ [INFO] Building traffic_web [INFO]<br>
    task-segment: [compile] [INFO]
    ------------------------------------------------------------------------ [INFO] [resources:resources
    {execution: default-resources}]
    [WARNING] Using platform encoding
    (Cp1250 actually) to copy filtered
    resources, i.e. build is platform
    dependent! [INFO] skip non existing
    resourceDirectory
    c:\Users\jwa\Desktop\tets\traffic_web\src\main\resources
    [INFO] [compiler:compile {execution:
    default-compile}] [INFO] Compiling 22
    source files to
    c:\Users\jwa\Desktop\tets\traffic_web\target\classes
    [INFO]
    ------------------------------------------------------------------------ [ERROR] BUILD FAILURE [INFO]
    ------------------------------------------------------------------------ [INFO] Compilation failure</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\Encryptor.java:[7,15]
    sun.misc.BASE64Encoder is Sun propriet
    ary API and may be removed in a future
    release</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\Session.java:[3,25]
    package javax.servlet.http does not
    exis t</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\Session.java:[15,21]
    cannot find symbol symbol  : class
    HttpSession location: class
    traffic_web.tools.Session</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[6,20]
    package javax. servlet does not exist</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[7,20]
    package javax. servlet does not exist</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[8,20]
    package javax. servlet does not exist</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[10,58]
    cannot find s ymbol symbol: class
    ServletContextListener public class
    ServletContextListenerInitializer
    implements ServletContextListener {</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[12,33]
    cannot find s ymbol symbol  : class
    ServletContextEvent location: class
    traffic_web.tools.ServletContextListenerInitializer</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[15,35]
    cannot find s ymbol symbol  : class
    ServletContextEvent location: class
    traffic_web.tools.ServletContextListenerInitializer</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\controller\BoardController.java:[9,25]
    package javax.servlet.http does not
    exist</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\controller\BoardController.java:[87,29]
    cannot find symbol symbol  : class
    HttpServletResponse location: class
    traffic_web.controller.BoardController</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\controller\BoardController.java:[116,37]
    cannot find symbol symbol  : class
    HttpServletResponse location: class
    traffic_web.controller.BoardController</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\Encryptor.java:[27,15]
    sun.misc.BASE64Encoder is Sun proprie
    tary API and may be removed in a
    future release</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\Session.java:[17,27]
    cannot access
    javax.servlet.http.HttpSe rvletRequest
    class file for
    javax.servlet.http.HttpServletRequest
    not found
                return attr.getRequest().getSession(true); //
    true == allow create</p>
    
    <p>c:\Users\jwa\Desktop\tets\traffic_web\src\traffic_web\tools\ServletContextListenerInitializer.java:[17,8]
    cannot find sy mbol symbol  : class
    ServletContext location: class
    traffic_web.tools.ServletContextListenerInitializer</p>
    
    <p>[INFO]
    ------------------------------------------------------------------------ [INFO] Trace
    org.apache.maven.BuildFailureException:
    Compilation failure
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:55
    6)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.jav
    a:387)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
            at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
            at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
            at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
            at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
    Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
            at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
            at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
            at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
    Caused by:
    org.apache.maven.plugin.CompilationFailureException:
    Compilation failure
            at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:516)
            at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
            at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
            at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
            ... 17 more [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 second [INFO]
    Finished at: Mon Jun 28 21:56:25 CEST
    2010 [INFO] Final Memory: 13M/254M</p>
    
    <h2>[INFO]</h2>
  </blockquote>
  
  <p>My POM file looks like that:</p>
  
  <pre><code>&lt;project&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;masters.traffic&lt;/groupId&gt;
    &lt;artifactId&gt;traffic_web&lt;/artifactId&gt;
    &lt;packaging&gt;war&lt;/packaging&gt;
    &lt;name&gt;traffic_web&lt;/name&gt;
    &lt;version&gt;0.1.0&lt;/version&gt;
    &lt;build&gt;
          &lt;sourceDirectory&gt;src&lt;/sourceDirectory&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;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;
  
      ...
  
  &lt;/project&gt;
  </code></pre>
  
  <p>Can Someone help me how to fix that ?</p>
  
  <p>Regards</p>