|
|
<?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>com.student</groupId>
|
|
|
<artifactId>mathquiz</artifactId>
|
|
|
<version>1.0-SNAPSHOT</version>
|
|
|
|
|
|
<properties>
|
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
|
<maven.compiler.source>17</maven.compiler.source>
|
|
|
<maven.compiler.target>17</maven.compiler.target>
|
|
|
<javafx.version>17.0.2</javafx.version>
|
|
|
<!-- ★★★ 关键修改1:把主类指向新的启动器 ★★★ -->
|
|
|
<main.class>com.student.mathquiz.Launcher</main.class>
|
|
|
</properties>
|
|
|
|
|
|
<dependencies>
|
|
|
<!-- ... 你的 dependencies 部分保持不变 ... -->
|
|
|
<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>com.google.code.gson</groupId>
|
|
|
<artifactId>gson</artifactId>
|
|
|
<version>2.10.1</version>
|
|
|
</dependency>
|
|
|
<dependency>
|
|
|
<groupId>com.sun.mail</groupId>
|
|
|
<artifactId>jakarta.mail</artifactId>
|
|
|
<version>2.0.1</version>
|
|
|
</dependency>
|
|
|
</dependencies>
|
|
|
|
|
|
<build>
|
|
|
<resources>
|
|
|
<resource>
|
|
|
<directory>src/main/resources</directory>
|
|
|
</resource>
|
|
|
</resources>
|
|
|
<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.openjfx</groupId>
|
|
|
<artifactId>javafx-maven-plugin</artifactId>
|
|
|
<version>0.0.8</version>
|
|
|
<configuration>
|
|
|
<!-- ★★★ 这里的 mainClass 会自动使用上面 properties 里的新值 ★★★ -->
|
|
|
<mainClass>${main.class}</mainClass>
|
|
|
</configuration>
|
|
|
</plugin>
|
|
|
<plugin>
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
<artifactId>maven-shade-plugin</artifactId>
|
|
|
<version>3.5.1</version>
|
|
|
<executions>
|
|
|
<execution>
|
|
|
<phase>package</phase>
|
|
|
<goals>
|
|
|
<goal>shade</goal>
|
|
|
</goals>
|
|
|
<configuration>
|
|
|
<transformers>
|
|
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
|
|
<!-- ★★★ 关键修改2:这里的 mainClass 也会自动使用新值 ★★★ -->
|
|
|
<mainClass>${main.class}</mainClass>
|
|
|
</transformer>
|
|
|
</transformers>
|
|
|
<filters>
|
|
|
<filter>
|
|
|
<artifact>*:*</artifact>
|
|
|
<excludes>
|
|
|
<exclude>module-info.class</exclude>
|
|
|
<exclude>META-INF/*.SF</exclude>
|
|
|
<exclude>META-INF/*.DSA</exclude>
|
|
|
<exclude>META-INF/*.RSA</exclude>
|
|
|
</excludes>
|
|
|
</filter>
|
|
|
</filters>
|
|
|
</configuration>
|
|
|
</execution>
|
|
|
</executions>
|
|
|
</plugin>
|
|
|
</plugins>
|
|
|
</build>
|
|
|
|
|
|
</project>
|