Skip to content

Instantly share code, notes, and snippets.

@TimoDJatomika
Created May 24, 2016 07:30
Show Gist options
  • Save TimoDJatomika/283e261b52501247ec958bbb5aeb050e to your computer and use it in GitHub Desktop.
Save TimoDJatomika/283e261b52501247ec958bbb5aeb050e to your computer and use it in GitHub Desktop.
Example of how to build a java package with mvn package
<project>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<!-- Run shade goal on package phase -->
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<!-- add Main-Class to manifest file -->
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>de.dwins.finiator.smartanalytics.Start</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment