Tweaks pom to create jar file with all dependencies
All checks were successful
KnarCraft/Minecraft-Server-Launcher/master This commit looks good

This commit is contained in:
Kristian Knarvik 2020-02-13 23:09:03 +01:00
parent 1e34571ca6
commit f0ad156e16

78
pom.xml
View File

@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>net.knarcraft.minecraftserverlauncher</groupId>
<artifactId>minecraftserverlauncher</artifactId>
<artifactId>minecraft-server-launcher</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
@ -40,29 +40,6 @@
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<repositories>
<repository>
<id>knarcraft</id>
<name>KnarCraft Repository</name>
<url>https://git.knarcraft.net/KnarCraft/Minecraft-Server-Launcher</url>
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<distributionManagement>
<repository>
<uniqueVersion>false</uniqueVersion>
<id>internal.repo</id>
<name>KnarCraft Repository</name>
<url>https://git.knarcraft.net</url>
<layout>default</layout>
</repository>
<downloadUrl>https://git.knarcraft.net/KnarCraft/Minecraft-Server-Launcher</downloadUrl>
</distributionManagement>
<build>
<plugins>
<plugin>
@ -80,6 +57,49 @@
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<appendAssemblyId>true</appendAssemblyId>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>net.knarcraft.minecraftserverlauncher.Main</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-jar-with-dependencies</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
<overWriteReleases>true</overWriteReleases>
<overWriteSnapshots>true</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<directory>${project.basedir}/target</directory>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
@ -100,16 +120,16 @@
</build>
<dependencies>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.5</version>
</dependency>
</dependencies>
</project>