How do I specify a main class in the manifest of my generated jar file?
<p>i try to using Eclipse Maven to build jar with dependencies
but when i execute </p>

<pre><code>java -jar App.jar
</code></pre>

<p>got the error : "no main method found"</p>

<p>My pom.xml looks like 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;com.maventest&lt;/groupId&gt;
    &lt;artifactId&gt;aproject&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;packaging&gt;jar&lt;/packaging&gt;
    &lt;name&gt;aproject&lt;/name&gt;
    &lt;url&gt;http://maven.apache.org&lt;/url&gt;
    &lt;properties&gt;
        &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
    &lt;/properties&gt;
    &lt;dependencies&gt;
        &lt;dependency&gt;
            &lt;groupId&gt;junit&lt;/groupId&gt;
            &lt;artifactId&gt;junit&lt;/artifactId&gt;
            &lt;version&gt;3.8.1&lt;/version&gt;
            &lt;scope&gt;test&lt;/scope&gt;
        &lt;/dependency&gt;

    &lt;/dependencies&gt;
&lt;/project&gt;
</code></pre>

<p>it's just a simple java code:</p>

<pre><code>package com.maventest.aproject;

public class App {
    public static void main( String[] args ) {
        System.out.println( "Hello World!" );
    }
}
</code></pre>

<p>eclipse version: 4.5.2</p>

<p>Can anyone help me with this?
Thanks.</p>