123 lines
4.7 KiB
XML
123 lines
4.7 KiB
XML
<?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>cn.infstar</groupId>
|
|
<artifactId>essentialsc</artifactId>
|
|
<version>1.2.0</version>
|
|
<packaging>jar</packaging>
|
|
|
|
<name>essentialsc</name>
|
|
|
|
<properties>
|
|
<java.version>21</java.version>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
<test.server.path>${project.basedir}/test-server/plugins</test.server.path>
|
|
</properties>
|
|
|
|
<build>
|
|
<defaultGoal>clean package</defaultGoal>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<version>3.13.0</version>
|
|
<configuration>
|
|
<source>${java.version}</source>
|
|
<target>${java.version}</target>
|
|
</configuration>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-shade-plugin</artifactId>
|
|
<version>3.5.3</version>
|
|
<executions>
|
|
<execution>
|
|
<phase>package</phase>
|
|
<goals>
|
|
<goal>shade</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
|
<version>3.1.0</version>
|
|
<executions>
|
|
<execution>
|
|
<id>copy-to-test-server</id>
|
|
<phase>package</phase>
|
|
<configuration>
|
|
<target>
|
|
<!-- 仅在 test-server 目录存在时执行 -->
|
|
<available file="${test.server.path}" property="test.server.exists"/>
|
|
<antcall target="copy-if-exists"/>
|
|
</target>
|
|
</configuration>
|
|
<goals>
|
|
<goal>run</goal>
|
|
</goals>
|
|
</execution>
|
|
</executions>
|
|
</plugin>
|
|
</plugins>
|
|
|
|
<!-- Ant 目标定义 -->
|
|
<pluginManagement>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-antrun-plugin</artifactId>
|
|
<version>3.1.0</version>
|
|
<configuration>
|
|
<target>
|
|
<target name="copy-if-exists" if="test.server.exists">
|
|
<echo message="Cleaning old plugin files..."/>
|
|
<delete>
|
|
<fileset dir="${test.server.path}" includes="essentialsc-*.jar"/>
|
|
</delete>
|
|
<echo message="Copying plugin to test server..."/>
|
|
<copy file="${project.build.directory}/${project.build.finalName}.jar"
|
|
tofile="${test.server.path}/${project.build.finalName}.jar"
|
|
overwrite="true"/>
|
|
<echo message="Plugin copied successfully!"/>
|
|
</target>
|
|
</target>
|
|
</configuration>
|
|
</plugin>
|
|
</plugins>
|
|
</pluginManagement>
|
|
<resources>
|
|
<resource>
|
|
<directory>src/main/resources</directory>
|
|
<filtering>true</filtering>
|
|
</resource>
|
|
</resources>
|
|
</build>
|
|
|
|
<repositories>
|
|
<!-- 阿里云 Maven 镜像 -->
|
|
<repository>
|
|
<id>aliyunmaven</id>
|
|
<url>https://maven.aliyun.com/repository/public</url>
|
|
</repository>
|
|
<!-- PaperMC 仓库 -->
|
|
<repository>
|
|
<id>papermc-repo</id>
|
|
<url>https://repo.papermc.io/repository/maven-public/</url>
|
|
</repository>
|
|
</repositories>
|
|
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>io.papermc.paper</groupId>
|
|
<artifactId>paper-api</artifactId>
|
|
<version>1.21.11-R0.1-SNAPSHOT</version>
|
|
<scope>provided</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
</project>
|