Creating an executable jar with maven
To be able to create an executable jar containing all the dependencies you have to had
the
command will build an executable jar with all the dependancies define in your pom.
Documentation : Maven Assembly Plugin
<build>
[...]
<plugins>
[...]
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>org.sinarf.myapp.MainClass</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
[...]
</plugins>
[...]
</build>
the
mvn assembly:assembly
command will build an executable jar with all the dependancies define in your pom.
Documentation : Maven Assembly Plugin