fix: 修复 CI 构建失败

This commit is contained in:
Coldsmile_7
2026-04-15 01:43:51 +08:00
parent cce34236cf
commit 298c14e706

39
pom.xml
View File

@@ -52,16 +52,9 @@
<phase>package</phase> <phase>package</phase>
<configuration> <configuration>
<target> <target>
<echo message="Cleaning old plugin files..."/> <!-- 仅在 test-server 目录存在时执行 -->
<!-- 删除测试服务器中所有旧版本的插件文件 --> <available file="${test.server.path}" property="test.server.exists"/>
<delete> <antcall target="copy-if-exists"/>
<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> </configuration>
<goals> <goals>
@@ -71,6 +64,32 @@
</executions> </executions>
</plugin> </plugin>
</plugins> </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> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>