|
|
|
|
@ -9,49 +9,76 @@
|
|
|
|
|
<version>1.0.0</version>
|
|
|
|
|
|
|
|
|
|
<properties>
|
|
|
|
|
<!-- 编译版本 -->
|
|
|
|
|
<maven.compiler.source>17</maven.compiler.source>
|
|
|
|
|
<maven.compiler.target>17</maven.compiler.target>
|
|
|
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
|
|
|
|
|
|
|
|
<!-- JavaFX 版本(LTS 推荐) -->
|
|
|
|
|
<javafx.version>21.0.8</javafx.version>
|
|
|
|
|
</properties>
|
|
|
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
|
<!-- Google Gson -->
|
|
|
|
|
<dependency>
|
|
|
|
|
<groupId>com.google.code.gson</groupId>
|
|
|
|
|
<artifactId>gson</artifactId>
|
|
|
|
|
<version>2.10.1</version>
|
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
|
|
<!-- JavaFX Controls (包含 ActionEvent, Button, Scene 等) -->
|
|
|
|
|
<dependency>
|
|
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
|
|
<artifactId>javafx-controls</artifactId>
|
|
|
|
|
<version>${javafx.version}</version>
|
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
|
|
<!-- JavaFX FXML (如果你使用 .fxml 布局文件) -->
|
|
|
|
|
<dependency>
|
|
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
|
|
<artifactId>javafx-fxml</artifactId>
|
|
|
|
|
<version>${javafx.version}</version>
|
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
|
|
<!-- JavaFX Graphics (基础图形支持) -->
|
|
|
|
|
<dependency>
|
|
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
|
|
<artifactId>javafx-graphics</artifactId>
|
|
|
|
|
<version>${javafx.version}</version>
|
|
|
|
|
</dependency>
|
|
|
|
|
</dependencies>
|
|
|
|
|
|
|
|
|
|
<build>
|
|
|
|
|
<plugins>
|
|
|
|
|
<!-- 禁用默认的 maven-jar-plugin 生成基础JAR -->
|
|
|
|
|
<!-- 插件1: 编译插件(确保使用 JDK 17) -->
|
|
|
|
|
<plugin>
|
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
|
<artifactId>maven-jar-plugin</artifactId>
|
|
|
|
|
<version>3.3.0</version>
|
|
|
|
|
<executions>
|
|
|
|
|
<execution>
|
|
|
|
|
<id>default-jar</id>
|
|
|
|
|
<phase>none</phase> <!-- 移除默认的打包阶段,不生成基础JAR -->
|
|
|
|
|
</execution>
|
|
|
|
|
</executions>
|
|
|
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
|
|
|
<version>3.11.0</version>
|
|
|
|
|
<configuration>
|
|
|
|
|
<source>17</source>
|
|
|
|
|
<target>17</target>
|
|
|
|
|
</configuration>
|
|
|
|
|
</plugin>
|
|
|
|
|
|
|
|
|
|
<!-- 仅保留 assembly 插件生成自定义JAR -->
|
|
|
|
|
<!-- 插件2: Assembly 打包插件(用于生成可运行的 fat jar) -->
|
|
|
|
|
<!-- 注意:开发时不要禁用默认 jar,否则 IDEA 无法运行 -->
|
|
|
|
|
<plugin>
|
|
|
|
|
<artifactId>maven-assembly-plugin</artifactId>
|
|
|
|
|
<version>3.6.0</version>
|
|
|
|
|
<configuration>
|
|
|
|
|
<archive>
|
|
|
|
|
<manifest>
|
|
|
|
|
<!-- 替换为你的主类全路径 -->
|
|
|
|
|
<mainClass>com.mathgenerator.Application</mainClass>
|
|
|
|
|
</manifest>
|
|
|
|
|
</archive>
|
|
|
|
|
<descriptorRefs>
|
|
|
|
|
<descriptorRef>jar-with-dependencies</descriptorRef>
|
|
|
|
|
</descriptorRefs>
|
|
|
|
|
<finalName>mathgenerator</finalName> <!-- 自定义文件名 -->
|
|
|
|
|
<appendAssemblyId>false</appendAssemblyId> <!-- 去掉后缀 -->
|
|
|
|
|
<finalName>mathgenerator</finalName>
|
|
|
|
|
<appendAssemblyId>false</appendAssemblyId>
|
|
|
|
|
<goal>single</goal>
|
|
|
|
|
</configuration>
|
|
|
|
|
<executions>
|
|
|
|
|
<execution>
|
|
|
|
|
@ -65,5 +92,4 @@
|
|
|
|
|
</plugin>
|
|
|
|
|
</plugins>
|
|
|
|
|
</build>
|
|
|
|
|
|
|
|
|
|
</project>
|