-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpom.xml
More file actions
144 lines (137 loc) · 5.9 KB
/
Copy pathpom.xml
File metadata and controls
144 lines (137 loc) · 5.9 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
<?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>
<groupId>kevin.serverapi</groupId>
<artifactId>ServerAPI</artifactId>
<version>1.1.0</version>
<packaging>jar</packaging>
<name>ServerAPI</name>
<description>A REST API allowing websites, Discord bots and dashboards to read live data from your Minecraft server.</description>
<url>https://github.com/Kevin28576/ServerAPI</url>
<licenses>
<license>
<name>ServerAPI Non-Commercial License</name>
<url>https://github.com/Kevin28576/ServerAPI/blob/main/LICENSE</url>
<!-- manual:本專案不發布至公開 Maven 倉庫,且商業使用需另行取得授權 -->
<distribution>manual</distribution>
<comments>非商業用途可自由使用;商業伺服器須事先取得書面授權。</comments>
</license>
</licenses>
<properties>
<!-- Paper 26.x 需要 Java 21+;如你的環境是更新的 JDK 可自行調整 -->
<maven.compiler.release>21</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<repositories>
<repository>
<id>papermc</id>
<url>https://repo.papermc.io/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<!-- 對齊伺服器版本:Paper 26.1.2 build 72 -->
<dependency>
<groupId>io.papermc.paper</groupId>
<artifactId>paper-api</artifactId>
<version>26.1.2.build.72-stable</version>
<scope>provided</scope>
</dependency>
<!-- LuckPerms API(Maven Central):用於查詢玩家 rank/primary group -->
<dependency>
<groupId>net.luckperms</groupId>
<artifactId>api</artifactId>
<version>5.4</version>
<scope>provided</scope>
</dependency>
<!--
以下函式庫在「執行期」由 Paper 的 PluginLoader(ServerAPILibraries)
自 Maven 下載並加入 classpath,因此這裡僅需 provided 供編譯。
實際 JDBC 驅動(sqlite/mysql/mariadb)以類別名稱字串載入,無需編譯相依。
-->
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>5.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>5.1.5</version>
<scope>provided</scope>
</dependency>
<!--
bStats 必須打包進 jar(compile),不能像上面那些交給 PluginLoader ——
每個插件都得帶自己那份並重新命名套件,否則多個插件的 bStats 會互相衝突。
-->
<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
<version>3.2.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<finalName>${project.name}-${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
</plugin>
<!-- 處理 plugin.yml 內的 ${project.version} 佔位 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>3.3.1</version>
</plugin>
<!--
把 bStats 搬到自己的套件底下。不重新命名的話,同一台伺服器上
多個插件會載入到同一份 org.bstats 類別,先載入的那份會決定行為。
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<createDependencyReducedPom>false</createDependencyReducedPom>
<!--
丟掉相依套件自己的 META-INF。不排除的話 shade 會警告
MANIFEST.MF 重疊;簽章檔(.SF/.DSA/.RSA)留著更糟,
內容經過重新命名後對不上,執行期會直接拋出驗證失敗。
-->
<filters>
<filter>
<artifact>org.bstats:*</artifact>
<excludes>
<exclude>META-INF/**</exclude>
</excludes>
</filter>
</filters>
<relocations>
<relocation>
<pattern>org.bstats</pattern>
<shadedPattern>kevin.serverapi.libs.bstats</shadedPattern>
</relocation>
</relocations>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
</build>
</project>