From 7f9f16cd5876b61bd4abd997fb4f6c06682da323 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot <noreply+git-craftbukkit@papermc.io> Date: Sat, 1 Jan 2011 19:37:22 +0100 Subject: [PATCH] Updated pom.xml to produce a 'ready to run' jar By: Erik Broes <erikbroes@grum.nl> --- paper-server/pom.xml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/paper-server/pom.xml b/paper-server/pom.xml index cbfb2c7444..548296f9fe 100644 --- a/paper-server/pom.xml +++ b/paper-server/pom.xml @@ -28,20 +28,28 @@ <scope>compile</scope> </dependency> </dependencies> - <!-- to add the manifest with the Main-Class --> + <!-- This builds a completely 'ready to start' jar with all dependencies inside --> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-jar-plugin</artifactId> - <version>2.3.1</version> - <configuration> - <archive> - <manifest> - <mainClass>org.bukkit.craftbukkit.Main</mainClass> - </manifest> - </archive> - </configuration> + <artifactId>maven-shade-plugin</artifactId> + <version>1.4</version> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>shade</goal> + </goals> + <configuration> + <transformers> + <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> + <mainClass>org.bukkit.craftbukkit.Main</mainClass> + </transformer> + </transformers> + </configuration> + </execution> + </executions> </plugin> </plugins> </build>