You need to set the main class in the manifest using the maven-jar-plugin
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>com.someclass.Main</mainClass> </manifest> </archive> </configuration> </plugin>
Taken from here.
EDIT
If you want to package the resulting jar with dependencies you can use this
<plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <archive> <manifest> <mainClass>fully.qualified.MainClass</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> </plugin>
Taken from here.
Failed to load Main-Class manifest attribute from target/my-app-1.0-SNAPSHOT.jar