|
|
<?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>
|
|
|
|
|
|
<!-- 新增Spring Boot父依赖(必要,用于插件版本管理) -->
|
|
|
<parent>
|
|
|
<groupId>org.springframework.boot</groupId>
|
|
|
<artifactId>spring-boot-starter-parent</artifactId>
|
|
|
<version>3.1.12</version>
|
|
|
<relativePath/>
|
|
|
</parent>
|
|
|
|
|
|
<groupId>com.mathquiz</groupId>
|
|
|
<artifactId>MathQuizApp</artifactId>
|
|
|
<version>1.04</version>
|
|
|
<packaging>jar</packaging>
|
|
|
|
|
|
<name>Math Quiz Application</name>
|
|
|
<description>小初高数学学习软件- JavaFX版本</description>
|
|
|
|
|
|
<repositories>
|
|
|
<repository>
|
|
|
<id>jitpack.io</id>
|
|
|
<url>https://jitpack.io</url>
|
|
|
</repository>
|
|
|
</repositories>
|
|
|
|
|
|
<properties>
|
|
|
<!-- 其他原有配置 -->
|
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
|
<maven.compiler.source>21</maven.compiler.source>
|
|
|
<maven.compiler.target>21</maven.compiler.target>
|
|
|
<javafx.version>21.0.2</javafx.version>
|
|
|
<spring-boot.maven.plugin.version>3.1.12</spring-boot.maven.plugin.version>
|
|
|
|
|
|
<!-- 新增:覆盖漏洞依赖的安全版本 -->
|
|
|
<logback.version>1.5.13</logback.version> <!-- 修复logback漏洞 -->
|
|
|
<snakeyaml.version>2.2</snakeyaml.version> <!-- 修复snakeyaml高风险漏洞 -->
|
|
|
<spring.version>6.0.22</spring.version> <!-- 升级Spring核心依赖到安全版本 -->
|
|
|
</properties>
|
|
|
|
|
|
<dependencies>
|
|
|
<!-- 保留原有依赖 -->
|
|
|
<dependency>
|
|
|
<groupId>com.google.code.gson</groupId>
|
|
|
<artifactId>gson</artifactId>
|
|
|
<version>2.10.1</version>
|
|
|
</dependency>
|
|
|
|
|
|
<dependency>
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
<artifactId>javafx-base</artifactId>
|
|
|
<version>${javafx.version}</version>
|
|
|
</dependency>
|
|
|
<dependency>
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
<artifactId>javafx-controls</artifactId>
|
|
|
<version>${javafx.version}</version>
|
|
|
</dependency>
|
|
|
<dependency>
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
<artifactId>javafx-fxml</artifactId>
|
|
|
<version>${javafx.version}</version>
|
|
|
</dependency>
|
|
|
<dependency>
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
<artifactId>javafx-graphics</artifactId>
|
|
|
<version>${javafx.version}</version>
|
|
|
</dependency>
|
|
|
|
|
|
<dependency>
|
|
|
<groupId>com.sun.mail</groupId>
|
|
|
<artifactId>javax.mail</artifactId>
|
|
|
<version>1.6.2</version>
|
|
|
</dependency>
|
|
|
|
|
|
<dependency>
|
|
|
<groupId>com.sun.activation</groupId>
|
|
|
<artifactId>javax.activation</artifactId>
|
|
|
<version>1.2.0</version>
|
|
|
</dependency>
|
|
|
|
|
|
<!-- 新增Spring Boot基础依赖(必要,否则插件可能无法工作) -->
|
|
|
<dependency>
|
|
|
<groupId>org.springframework.boot</groupId>
|
|
|
<artifactId>spring-boot-starter</artifactId>
|
|
|
</dependency>
|
|
|
</dependencies>
|
|
|
|
|
|
<build>
|
|
|
<plugins>
|
|
|
<!-- 保留编译器插件 -->
|
|
|
<plugin>
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
|
<version>3.11.0</version>
|
|
|
<configuration>
|
|
|
<source>${maven.compiler.source}</source>
|
|
|
<target>${maven.compiler.target}</target>
|
|
|
<encoding>UTF-8</encoding>
|
|
|
</configuration>
|
|
|
</plugin>
|
|
|
|
|
|
<!-- 保留资源插件 -->
|
|
|
<plugin>
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
<artifactId>maven-resources-plugin</artifactId>
|
|
|
<version>3.3.1</version>
|
|
|
<configuration>
|
|
|
<encoding>UTF-8</encoding>
|
|
|
</configuration>
|
|
|
</plugin>
|
|
|
|
|
|
<plugin>
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
<artifactId>maven-dependency-plugin</artifactId>
|
|
|
<version>3.6.1</version>
|
|
|
<executions>
|
|
|
<execution>
|
|
|
<id>copy-javafx-dependencies</id>
|
|
|
<phase>compile</phase> <!-- 编译阶段就复制,确保运行前可用 -->
|
|
|
<goals>
|
|
|
<goal>copy-dependencies</goal>
|
|
|
</goals>
|
|
|
<configuration>
|
|
|
<includeGroupIds>org.openjfx</includeGroupIds> <!-- 仅复制JavaFX相关依赖 -->
|
|
|
<outputDirectory>${project.build.directory}/javafx-libs</outputDirectory> <!-- 复制到target/javafx-libs -->
|
|
|
</configuration>
|
|
|
</execution>
|
|
|
</executions>
|
|
|
</plugin>
|
|
|
|
|
|
<plugin>
|
|
|
<groupId>org.springframework.boot</groupId>
|
|
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
|
|
<version>${spring-boot.maven.plugin.version}</version>
|
|
|
<configuration>
|
|
|
<mainClass>com.pair.Test</mainClass> <!-- 确保主类正确 -->
|
|
|
<jvmArguments>
|
|
|
<!-- 指向复制的JavaFX依赖目录 -->
|
|
|
--module-path ${project.build.directory}/javafx-libs --add-modules javafx.controls,javafx.fxml,javafx.graphics,javafx.base
|
|
|
--add-modules javafx.controls,javafx.fxml,javafx.graphics,javafx.base
|
|
|
</jvmArguments>
|
|
|
</configuration>
|
|
|
<executions>
|
|
|
<execution>
|
|
|
<goals>
|
|
|
<goal>repackage</goal>
|
|
|
</goals>
|
|
|
</execution>
|
|
|
</executions>
|
|
|
</plugin>
|
|
|
</plugins>
|
|
|
</build>
|
|
|
</project> |