Sunday, September 4, 2011

Maven assembly plugin to create a executable jar file

Use mainClass to specify the class to be executed. You can instruct maven to package all dependent jar files to this by including jar-with-dependencies

<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>com.xxx.test.Test</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>

No comments: