title: maven: no main manifest attribute
body: <p>I am working on my web java project. When I try to run java jar file built by maven, I get an error:</p>
  
  <pre><code>no main manifest attribute, in "project name".
  </code></pre>
  
  <p>I think the reason is maven can't find my main class. I have created test project with this hierarchy:</p>
  
  <pre><code>/test
      /src
          /main
               Main.java
      pom.xml
  </code></pre>
  
  <p>The pom.xml file contains this:</p>
  
  <pre><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;FirstProject&lt;/groupId&gt;
  &lt;artifactId&gt;FirstProject&lt;/artifactId&gt;
  &lt;version&gt;1.0&lt;/version&gt;
  
  &lt;properties&gt;
      &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
  &lt;/properties&gt;
  
  &lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
              &lt;groupId&gt;org.apache.maven.plugin&lt;/groupId&gt;
              &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
              &lt;version&gt;2.4&lt;/version&gt;
          &lt;/plugin&gt;
          &lt;plugin&gt;
  
              &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
              &lt;configuration&gt;
                  &lt;descriptorRefs&gt;
                      &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                  &lt;/descriptorRefs&gt;
                      &lt;outputDirectory&gt;${basedir}&lt;/outputDirectory&gt;
                      &lt;finalName&gt;server&lt;/finalName&gt;
                      &lt;appendAssemblyId&gt;false&lt;/appendAssemblyId&gt;
                   &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;mainClass&gt;main.Main&lt;/mainClass&gt;
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                  &lt;/configuration&gt;
      &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p></p>
  
  <p>Also get this error in test project. I tried to google it, everybody advise to add  in pom.xml, but I already have done this...(it is not a solution, in my case). How can I solve this problem?</p>