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>

Wednesday, August 31, 2011

Install a jar into your local Maven repository

Install a jar into your local Maven repository


mvn install:install-file -DgroupId=  -DartifactId= -Dversion=  -Dfile=  -Dpackaging=jar -DgeneratePom=true