支持打包

This commit is contained in:
张家训
2026-06-11 14:10:40 +08:00
parent feeabf9f59
commit 075bf46ef2
8 changed files with 267 additions and 0 deletions
+40
View File
@@ -187,6 +187,18 @@
<systemPath>${java.home}/lib/ext/jfxrt.jar</systemPath>
</dependency>
<!-- JNA: 用于 Windows 控制台代码页切换 (UTF-8) -->
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.14.0</version>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna-platform</artifactId>
<version>5.14.0</version>
</dependency>
</dependencies>
<build>
@@ -196,6 +208,34 @@
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>2.5.3</version>
<executions>
<execution>
<id>l4j-exe</id>
<phase>package</phase>
<goals><goal>launch4j</goal></goals>
<configuration>
<headerType>console</headerType>
<jar>${project.build.directory}/${project.build.finalName}.jar</jar>
<outfile>${project.build.directory}/workutils.exe</outfile>
<dontWrapJar>false</dontWrapJar>
<classPath>
<mainClass>org.springframework.boot.loader.JarLauncher</mainClass>
</classPath>
<jre>
<minVersion>1.8.0</minVersion>
<opts>
<opt>-Dfile.encoding=UTF-8</opt>
</opts>
</jre>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>