title: Failed to load main class while executing war
body: <p>I build my project using maven and generated a *.war file with the following content structure:</p>
  
  <pre><code>META-INF
  - maven
  -- net.avedo.spozz
  --- Spozz-Webservice
  ---- pom.properties
  ---- pom.xml
  - MANIFEST.MF
  WEB-INF
  - classes
  -- net
  --- avedo
  ---- spozz
  ----- Spozz.class
  ----- models
  ------ ...
  ----- services
  ------ ...
  -- psql-custom.properties
  - lib
  -- ...
  - web.xml
  </code></pre>
  
  <p>If I now try to run the generated war file using <code>java -jar spozz.war</code>, I get the following error:</p>
  
  <pre><code>Error: Could not find or load main class net.avedo.spozz.Spozz
  </code></pre>
  
  <p>What did I wrong? Please find the Manifest file and the definition of the maven-war-plugin in the <code>pom.xml</code> below.</p>
  
  <p><strong>MANIFEST.MF</strong></p>
  
  <pre><code>Manifest-Version: 1.0
  Built-By: awilhelm
  Build-Jdk: 1.7.0_51
  Class-Path: javax.servlet-api-3.1.0.jar jetty-webapp-9.1.3.v20140225.j
   ar jetty-xml-9.1.3.v20140225.jar jetty-servlet-9.1.3.v20140225.jar je
   tty-security-9.1.3.v20140225.jar jetty-server-9.1.3.v20140225.jar jet
   ty-servlets-9.1.3.v20140225.jar jetty-continuation-9.1.3.v20140225.ja
   r jetty-http-9.1.3.v20140225.jar jetty-io-9.1.3.v20140225.jar jetty-j
   sp-9.1.3.v20140225.jar jetty-schemas-3.1.M0.jar javax.servlet.jsp-api
   -2.3.1.jar javax.servlet.jsp-2.3.2.jar javax.servlet.jsp.jstl-1.2.0.v
   201105211821.jar javax.servlet.jsp.jstl-1.2.2.jar javax.el-3.0.0.jar 
   org.eclipse.jdt.core-3.8.2.v20130121.jar jetty-util-9.1.3.v20140225.j
   ar jettison-1.3.5.jar stax-api-1.0.1.jar resteasy-jaxrs-3.0.6.Final.j
   ar scannotation-1.0.3.jar javassist-3.12.1.GA.jar jboss-annotations-a
   pi_1.1_spec-1.0.1.Final.jar activation-1.1.jar jcip-annotations-1.0.j
   ar resteasy-client-3.0.6.Final.jar async-http-servlet-3.0-3.0.6.Final
   .jar jaxrs-api-3.0.6.Final.jar resteasy-servlet-initializer-3.0.6.Fin
   al.jar log4j-1.2.17.jar slf4j-api-1.7.6.jar slf4j-log4j12-1.7.6.jar c
   ommons-io-2.4.jar ormlite-jdbc-4.48.jar ormlite-core-4.48.jar
  Created-By: Apache Maven 3.2.1
  Main-Class: net.avedo.spozz.Spozz
  Archiver-Version: Plexus Archiver
  </code></pre>
  
  <p><strong>Extract from pom.xml</strong></p>
  
  <pre><code>&lt;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
      &lt;version&gt;${maven.war.plugin.version}&lt;/version&gt;
      &lt;configuration&gt;
          &lt;webXml&gt;src\main\webapp\WEB-INF\web.xml&lt;/webXml&gt;
          &lt;archive&gt;
              &lt;manifest&gt;
                  &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                  &lt;mainClass&gt;net.avedo.spozz.Spozz&lt;/mainClass&gt;
              &lt;/manifest&gt;
          &lt;/archive&gt;
      &lt;/configuration&gt;
  &lt;/plugin&gt;
  </code></pre>