优化打包规则,增加jf依赖

This commit is contained in:
张家训
2026-06-11 17:57:13 +08:00
parent 317f6fe6b1
commit 89ff93f78e
4 changed files with 55 additions and 12 deletions
+42 -6
View File
@@ -1,7 +1,7 @@
[INFO] Scanning for projects... [INFO] Scanning for projects...
[WARNING] [WARNING]
[WARNING] Some problems were encountered while building the effective model for com.example:workutils:jar:0.0.1-SNAPSHOT [WARNING] Some problems were encountered while building the effective model for com.example:workutils:jar:0.0.1-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.alibaba:fastjson:jar -> version 2.0.57 vs 1.2.83 @ line 138, column 21 [WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: com.alibaba:fastjson:jar -> version 2.0.57 vs 1.2.83 @ line 146, column 21
[WARNING] [WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build. [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING] [WARNING]
@@ -12,9 +12,10 @@
[INFO] Building workutils 0.0.1-SNAPSHOT [INFO] Building workutils 0.0.1-SNAPSHOT
[INFO] from pom.xml [INFO] from pom.xml
[INFO] --------------------------------[ jar ]--------------------------------- [INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for com.oracle.javafx:jfxrt:jar:8.0 is missing, no dependency information available
[INFO] [INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ workutils --- [INFO] --- clean:3.2.0:clean (default-clean) @ workutils ---
[INFO] Deleting d:\workspace\workutils\target [INFO] Deleting D:\workspace\workutils\target
[INFO] [INFO]
[INFO] --- resources:3.2.0:resources (default-resources) @ workutils --- [INFO] --- resources:3.2.0:resources (default-resources) @ workutils ---
[INFO] Using 'UTF-8' encoding to copy filtered resources. [INFO] Using 'UTF-8' encoding to copy filtered resources.
@@ -24,10 +25,45 @@
[INFO] [INFO]
[INFO] --- compiler:3.10.1:compile (default-compile) @ workutils --- [INFO] --- compiler:3.10.1:compile (default-compile) @ workutils ---
[INFO] Changes detected - recompiling the module! [INFO] Changes detected - recompiling the module!
[INFO] Compiling 36 source files to d:\workspace\workutils\target\classes [INFO] Compiling 36 source files to D:\workspace\workutils\target\classes
[INFO]
[INFO] --- resources:3.2.0:testResources (default-testResources) @ workutils ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] skip non existing resourceDirectory D:\workspace\workutils\src\test\resources
[INFO]
[INFO] --- compiler:3.10.1:testCompile (default-testCompile) @ workutils ---
[INFO] No sources to compile
[INFO]
[INFO] --- surefire:2.22.2:test (default-test) @ workutils ---
[INFO] Tests are skipped.
[INFO]
[INFO] --- jar:3.2.2:jar (default-jar) @ workutils ---
[INFO] Building jar: D:\workspace\workutils\target\workutils-0.0.1-SNAPSHOT.jar
[INFO]
[INFO] --- spring-boot:2.7.18:repackage (repackage) @ workutils ---
[INFO] Replacing main artifact with repackaged archive
[INFO]
[INFO] --- launch4j:2.5.3:launch4j (l4j-exe) @ workutils ---
[WARNING] jre.path not set, defaulting to "%JAVA_HOME%;%PATH%"
[WARNING] Configuration param ${project.organization.name} is empty, so a dummy value "Default organization" might be used instead to fulfill some of VersionInfo params by defaults.
[WARNING] Configuration param ${project.inceptionYear} is empty, so a dummy value "2020" might be used instead to fulfill some of VersionInfo params by defaults.
[INFO] Found launch4j version 3.50
[INFO] Platform-specific work directory already exists: C:\Users\73212\.m2\repository\net\sf\launch4j\launch4j\3.50\launch4j-3.50-workdir-win32
[INFO] Using workdir C:\Users\73212\.m2\repository\net\sf\launch4j\launch4j\3.50\launch4j-3.50-workdir-win32
[INFO] launch4j: Compiling resources
[INFO] launch4j: Linking
[INFO] launch4j: Wrapping
WARNING: Sign the executable to minimize antivirus false positives or use launching instead of wrapping.
[INFO] launch4j: Successfully created D:\workspace\workutils\target\workutils.exe
[INFO]
[INFO] --- resources:3.2.0:copy-resources (copy-start-bat) @ workutils ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Using 'UTF-8' encoding to copy filtered properties files.
[INFO] Copying 1 resource
[INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS [INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.983 s [INFO] Total time: 12.415 s
[INFO] Finished at: 2026-06-11T15:23:52+08:00 [INFO] Finished at: 2026-06-11T17:28:56+08:00
[INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------
Binary file not shown.
BIN
View File
Binary file not shown.
+13 -6
View File
@@ -10,7 +10,7 @@
</parent> </parent>
<groupId>com.example</groupId> <groupId>com.example</groupId>
<artifactId>workutils</artifactId> <artifactId>workutils</artifactId>
<version>0.0.1-SNAPSHOT</version> <version>0.0.2-SNAPSHOT</version>
<name>workutils</name> <name>workutils</name>
<description>workutils</description> <description>workutils</description>
<properties> <properties>
@@ -22,6 +22,14 @@
<!-- Maven 编译/测试启动时的 JVM 参数,确保 IDEA 内运行不乱码 --> <!-- Maven 编译/测试启动时的 JVM 参数,确保 IDEA 内运行不乱码 -->
<argLine>-Dfile.encoding=UTF-8</argLine> <argLine>-Dfile.encoding=UTF-8</argLine>
</properties> </properties>
<repositories>
<!-- 本地文件仓库:存放外部 jar(如 jfxrt.jar),随项目分发 -->
<repository>
<id>local-lib-repo</id>
<url>file://${project.basedir}/lib-repo</url>
</repository>
</repositories>
<dependencies> <dependencies>
<dependency> <dependency>
@@ -182,13 +190,12 @@
</exclusions> </exclusions>
</dependency> </dependency>
<!-- JavaFX 8(OracleJDK8 内置;OpenJDK8 需安装 OpenJFX 后调整路径) --> <!-- JavaFX 8:jfxrt.jar 已提取至 lib/ 目录,build 时自动安装到本地 Maven 仓库 -->
<!-- 最终打入 fat jar,JRE 环境无需内置 JavaFX -->
<dependency> <dependency>
<groupId>com.oracle</groupId> <groupId>com.oracle.javafx</groupId>
<artifactId>javafx</artifactId> <artifactId>jfxrt</artifactId>
<version>8.0</version> <version>8.0</version>
<scope>system</scope>
<systemPath>${java.home}/lib/ext/jfxrt.jar</systemPath>
</dependency> </dependency>
<!-- JNA: 用于 Windows 控制台代码页切换 (UTF-8) --> <!-- JNA: 用于 Windows 控制台代码页切换 (UTF-8) -->