Last active
August 14, 2022 01:47
-
-
Save Exerosis/89cade862d386ef1b476e158b3ad208d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ${project.name} | |
version: ${project.version} | |
#Might need to change this depending on your package structure, but it's standard not to. | |
main: ${project.groupId}.${project.artifactId} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Tell maven that we want to add to the repositories it will look in when it tries to find jar files for us--> | |
<repositories> | |
<!--This is the respository that stores the spigot API jar files online--> | |
<repository> | |
<id>spigot-repo</id> | |
<url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url> | |
</repository> | |
</repositories> | |
<!--Tell maven the id and version of each dependancy our project needs so it can download it from a repository--> | |
<dependencies> | |
<!--Tell maven to add a version of spigot to our project--> | |
<dependency> | |
<groupId>org.spigotmc</groupId> | |
<artifactId>spigot-api</artifactId> | |
<version>1.12.2-R0.1-SNAPSHOT</version> | |
<!--Tell maven not to include a copy of the spigot API in your plugin as it's already in the server's jar--> | |
<scope>provided</scope> | |
</dependency> | |
</dependencies> | |
<!--Tell maven to compile our project using java 8--> | |
<properties> | |
<maven.compiler.source>1.8</maven.compiler.source> | |
<maven.compiler.target>1.8</maven.compiler.target> | |
</properties> | |
<!--Tell maven how to prepare and build our jar file from our source and dependancies--> | |
<build> | |
<!--Tell maven what plugins we want to add and what they should do--> | |
<plugins> | |
<!--Tell maven the id and version of the 'shade' plugin's jar file so it can download it from a repository--> | |
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-shade-plugin</artifactId> | |
<version>3.1.0</version> | |
<executions> | |
<!--Tell the shade plugin when it should be run during a maven build--> | |
<execution> | |
<!--Tell the shade plugin to run once during the 'package' phase of a maven build--> | |
<phase>package</phase> | |
<!--Tell the shade plugin which of it's goals to attempt to run during this phase--> | |
<goals> | |
<goal>shade</goal> | |
</goals> | |
<!--Tell the shade plugin which of it's goals to attempt to run during this phase--> | |
<configuration> | |
<!--Tell the shade plugin where to put our jar file--> | |
<outputFile>${project.basedir}/Server/plugins/${project.artifactId}.jar</outputFile> | |
<minimizeJar>true</minimizeJar> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> | |
</plugins> | |
<!--Tell maven to enable resource filtering so we can use macros like '${project.version}' inside of our plugin.yml--> | |
<resources> | |
<resource> | |
<directory>src/main/resources</directory> | |
<filtering>true</filtering> | |
</resource> | |
</resources> | |
</build> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment