Skip to content

Instantly share code, notes, and snippets.

@fwilhe
Created August 16, 2014 19:30
Show Gist options
  • Save fwilhe/cb42bfb0e94b32b051d7 to your computer and use it in GitHub Desktop.
Save fwilhe/cb42bfb0e94b32b051d7 to your computer and use it in GitHub Desktop.
Maven shade plugin-config to set the main-class for a *.jar-file.
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.foo.bar.app.Main</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment