As the title says ...
Use the maven-assembly-plugin
plugin to package all the dependencies.
Add it under project-> build-> plugins in pom.xml
.
pom.xml
<build>
<plugins>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
<configuration>
<archive>
<manifest>
<mainClass>com.example.App</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>
</plugins>
</build>
Like this.
If you don't specify configuration
-> ʻarchive-
manifest->
mainClass` (at least in my trial), the title will say" No main manifest attribute "when running the jar. I did.