-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpom.xml
More file actions
120 lines (112 loc) · 4.88 KB
/
pom.xml
File metadata and controls
120 lines (112 loc) · 4.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- details about the project -->
<groupId>com.example.template</groupId> <!-- package name, must be equal to the package structure -->
<artifactId>paper-plugin-template</artifactId> <!-- plugin name -->
<version>0.1</version>
<properties>
<!-- java version -->
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<!-- Minecraft version -->
<versions.minecraft.minor>1.21.5</versions.minecraft.minor>
<versions.minecraft.major>1.21</versions.minecraft.major>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<plugin.class.main>Main</plugin.class.main> <!-- default class name, we use Main.java -->
<!-- the file name of the built jar -->
<name.jar>${project.name}-${project.version}</name.jar>
</properties>
<build>
<finalName>${name.jar}</finalName>
<sourceDirectory>src/main/java</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.target}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<dependencyReducedPomLocation>${project.build.directory}/dependency-reduced-pom.xml</dependencyReducedPomLocation>
<filters>
<!-- do not include a META-INF in the jar -->
<!-- this is not needed for Minecraft plugins -->
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/**</exclude>
</excludes>
</filter>
</filters>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<!-- copy the built jar to the root directory -->
<execution>
<id>copy-files-on-build</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>.</outputDirectory>
<resources>
<resource>
<directory>${project.build.directory}</directory>
<include>${name.jar}.jar</include>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<!-- copy over everything from the resources folder into the jar, i.e. plugin.yml -->
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<targetPath>.</targetPath>
</resource>
</resources>
</build>
<repositories>
<!-- the repository to check for the paper api -->
<repository>
<id>paper-repo</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<!-- the dependency for the paper api -->
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>${versions.minecraft.minor}-R0.1-SNAPSHOT</version>
<!-- we want the scope 'provided', so it won't include into the jar -->
<scope>provided</scope>
</dependency>
</dependencies>
</project>