Skip to content

Instantly share code, notes, and snippets.

@henriquegogo
Created March 13, 2014 17:23
Show Gist options
  • Save henriquegogo/9532845 to your computer and use it in GitHub Desktop.
Save henriquegogo/9532845 to your computer and use it in GitHub Desktop.
Maven parameters to pack jar with dependencies and use a main class
<project>
...
<build>
<plugins>
<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> <!-- this is used for inheritance merges -->
<phase>package</phase> <!-- bind to the packaging phase -->
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment