title: maven didn't add main-class properly
body: <p>I want to compile my Java-Project with maven but it didn't add the main-class to the manifest file. So i can't run the jar outside of intellij. I've added the main-class to my pom.xml but it don't show up in the manifest file.</p>
  
  <p>I'm using the build function of intellij on a Win10 machine and maven3 (IntelliJ IDEA 2018.3.1/plugins/maven/lib/maven3).</p>
  
  <p>If i run the jar i get the error</p>
  
  <pre><code>$java -jar myJar.jar
  kein Hauptmanifestattribut, in myJar.jar
  </code></pre>
  
  <p>(German for: <em>no main manifest attribute, in myJar.jar</em>, i don't know the exact english translation for that but it means: <em>no main class specified</em>)</p>
  
  <p>I've tried serveral maven plugins (maven-compile, maven-jar, maven-shade) and ways to specify the main-class but non of them added it to the manifest file. The only way i get this to work is when i added the line</p>
  
  <pre><code>Main-Class: Main
  </code></pre>
  
  <p>by hand.</p>
  
  <p>my pom file (yes, my main-class called <em>Main</em> and yes it works fine when i added it by hand)</p>
  
  <pre><code>...
  
      &lt;groupId&gt;com.myname&lt;/groupId&gt;
      &lt;artifactId&gt;myProject&lt;/artifactId&gt;
      &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                  &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
                  &lt;configuration&gt;
                      &lt;archive&gt;
                          &lt;manifest&gt;
                              &lt;addClasspath&gt;true&lt;/addClasspath&gt;
                              &lt;mainClass&gt;Main&lt;/mainClass&gt;
                          &lt;/manifest&gt;
                      &lt;/archive&gt;
                  &lt;/configuration&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&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;
  
  ...
  </code></pre>
  
  <p>the manifest file</p>
  
  <pre><code>Manifest-Version: 1.0
  Archiver-Version: Plexus Archiver
  Built-By: dspicuzz
  Created-By: Apache Maven 3.3.9
  Build-Jdk: 1.8.0_65
  </code></pre>
  
  <p>If i added the line by hand it runs fine</p>
  
  <pre><code>Manifest-Version: 1.0
  Archiver-Version: Plexus Archiver
  Built-By: dspicuzz
  Created-By: Apache Maven 3.3.9
  Build-Jdk: 1.8.0_65
  Main-Class: Main
  </code></pre>
  
  <p>But i can't get maven to generate it for me this way.</p>