|
|
|
|
@ -15,6 +15,7 @@
|
|
|
|
|
<maven.compiler.target>17</maven.compiler.target>
|
|
|
|
|
<junit.version>5.10.0</junit.version>
|
|
|
|
|
<javafx.version>17.0.6</javafx.version>
|
|
|
|
|
<javafx.platform>win</javafx.platform>
|
|
|
|
|
</properties>
|
|
|
|
|
|
|
|
|
|
<dependencies>
|
|
|
|
|
@ -23,21 +24,38 @@
|
|
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
|
|
<artifactId>javafx-controls</artifactId>
|
|
|
|
|
<version>${javafx.version}</version>
|
|
|
|
|
<classifier>${javafx.platform}</classifier> <!-- 添加 -->
|
|
|
|
|
</dependency>
|
|
|
|
|
<dependency>
|
|
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
|
|
<artifactId>javafx-fxml</artifactId>
|
|
|
|
|
<version>${javafx.version}</version>
|
|
|
|
|
<classifier>${javafx.platform}</classifier>
|
|
|
|
|
</dependency>
|
|
|
|
|
<dependency>
|
|
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
|
|
<artifactId>javafx-base</artifactId>
|
|
|
|
|
<version>${javafx.version}</version>
|
|
|
|
|
<classifier>${javafx.platform}</classifier>
|
|
|
|
|
</dependency>
|
|
|
|
|
<dependency>
|
|
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
|
|
<artifactId>javafx-graphics</artifactId>
|
|
|
|
|
<version>${javafx.version}</version>
|
|
|
|
|
<classifier>${javafx.platform}</classifier>
|
|
|
|
|
</dependency>
|
|
|
|
|
<!-- 其他 JavaFX 模块也加上 classifier -->
|
|
|
|
|
<dependency>
|
|
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
|
|
<artifactId>javafx-web</artifactId>
|
|
|
|
|
<version>${javafx.version}</version>
|
|
|
|
|
<classifier>${javafx.platform}</classifier>
|
|
|
|
|
</dependency>
|
|
|
|
|
<dependency>
|
|
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
|
|
<artifactId>javafx-media</artifactId>
|
|
|
|
|
<version>${javafx.version}</version>
|
|
|
|
|
<classifier>${javafx.platform}</classifier>
|
|
|
|
|
</dependency>
|
|
|
|
|
|
|
|
|
|
<!-- 其他依赖保持不变 -->
|
|
|
|
|
@ -140,6 +158,7 @@
|
|
|
|
|
|
|
|
|
|
<build>
|
|
|
|
|
<plugins>
|
|
|
|
|
<!-- 编译插件 -->
|
|
|
|
|
<plugin>
|
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
|
|
|
@ -147,23 +166,38 @@
|
|
|
|
|
<configuration>
|
|
|
|
|
<source>17</source>
|
|
|
|
|
<target>17</target>
|
|
|
|
|
<!-- 移除了 -enable-preview 选项 -->
|
|
|
|
|
</configuration>
|
|
|
|
|
</plugin>
|
|
|
|
|
|
|
|
|
|
<!-- 打包成 fat jar -->
|
|
|
|
|
<plugin>
|
|
|
|
|
<groupId>org.openjfx</groupId>
|
|
|
|
|
<artifactId>javafx-maven-plugin</artifactId>
|
|
|
|
|
<version>0.0.8</version>
|
|
|
|
|
<configuration>
|
|
|
|
|
<!-- 根据你的实际主类修改 -->
|
|
|
|
|
<mainClass>com.wsf.mathapp.Main</mainClass>
|
|
|
|
|
<!-- 移除了 preview 选项 -->
|
|
|
|
|
</configuration>
|
|
|
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
|
|
|
<artifactId>maven-shade-plugin</artifactId>
|
|
|
|
|
<version>3.5.0</version>
|
|
|
|
|
<executions>
|
|
|
|
|
<execution>
|
|
|
|
|
<id>default-cli</id>
|
|
|
|
|
<phase>package</phase>
|
|
|
|
|
<goals>
|
|
|
|
|
<goal>shade</goal>
|
|
|
|
|
</goals>
|
|
|
|
|
<configuration>
|
|
|
|
|
<mainClass>com.wsf.mathapp.Main</mainClass>
|
|
|
|
|
<transformers>
|
|
|
|
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
|
|
|
|
<mainClass>com.wsf.mathapp.MathApplication</mainClass>
|
|
|
|
|
</transformer>
|
|
|
|
|
</transformers>
|
|
|
|
|
<!-- <filters>-->
|
|
|
|
|
<!-- <filter>-->
|
|
|
|
|
<!-- <artifact>*:*</artifact>-->
|
|
|
|
|
<!-- <excludes>-->
|
|
|
|
|
<!-- <exclude>META-INF/*.SF</exclude>-->
|
|
|
|
|
<!-- <exclude>META-INF/*.DSA</exclude>-->
|
|
|
|
|
<!-- <exclude>META-INF/*.RSA</exclude>-->
|
|
|
|
|
<!-- </excludes>-->
|
|
|
|
|
<!-- </filter>-->
|
|
|
|
|
<!-- </filters>-->
|
|
|
|
|
<!-- 关键:不要裁剪 META-INF/native -->
|
|
|
|
|
<minimizeJar>false</minimizeJar>
|
|
|
|
|
</configuration>
|
|
|
|
|
</execution>
|
|
|
|
|
</executions>
|
|
|
|
|
|