优化宇视打包jar包依赖问题

This commit is contained in:
zc
2026-04-10 01:21:00 +08:00
parent c03bcfb043
commit 371daf2eee
4 changed files with 85 additions and 12 deletions

View File

@@ -110,7 +110,7 @@
<systemPath>${project.basedir}/Library/MvCameraControlWrapper.jar</systemPath>
</dependency>
<!-- 本地库JNA -->
<!-- 本地库JNA (宇视SDK依赖旧版本) -->
<dependency>
<groupId>com.sun.jna</groupId>
<artifactId>jna</artifactId>
@@ -118,11 +118,6 @@
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/jna.jar</systemPath>
</dependency>
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.13.0</version>
</dependency>
<!-- 串口通信依赖 -->
<dependency>
@@ -160,7 +155,7 @@
</manifest>
<manifestEntries>
<!--为 MANIFEST.MF 中的 Class-Path 加入配置文件目录前缀 -->
<Class-Path>../${config-path}</Class-Path>
<Class-Path>../${config-path} ../${config-path}lib/jna.jar ../${lib-path}jna.jar</Class-Path>
</manifestEntries>
</archive>
<outputDirectory>${project.build.directory}/app/${bin-path}</outputDirectory>
@@ -179,6 +174,18 @@
</goals>
<configuration>
<outputDirectory>${project.build.directory}/app/${lib-path}</outputDirectory>
<includeScope>runtime</includeScope>
</configuration>
</execution>
<execution>
<id>copy-system-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/app/${lib-path}</outputDirectory>
<includeScope>system</includeScope>
</configuration>
</execution>
</executions>
@@ -207,11 +214,23 @@
<include>logback-spring.xml</include>
</includes>
</resource>
</resources>
<outputDirectory>${project.build.directory}/app/${config-path}</outputDirectory>
</configuration>
</execution>
<execution>
<id>copy-lib-resources</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<resources>
<resource>
<directory>src/main/resources/lib</directory>
</resource>
</resources>
<outputDirectory>${project.build.directory}/app/${config-path}</outputDirectory>
<outputDirectory>${project.build.directory}/app/${config-path}lib</outputDirectory>
</configuration>
</execution>
</executions>

View File

@@ -1,7 +1,9 @@
package top.wms.admin.controller.ys.lib;
import com.sun.jna.Platform;
import lombok.extern.slf4j.Slf4j;
@Slf4j
class BaseFun {
// 获取操作平台信息
public static String getOsArch() {
@@ -51,7 +53,8 @@ class BaseFun {
loadLibrary = filePath + "\\config\\lib\\win64\\";
}
String loadSDKLibrary = loadLibrary + "NetDEVSDK";
System.out.printf("[Load SDKLibrary Path : %s]\n", loadSDKLibrary);
log.info("Load SDK Library: " + loadSDKLibrary);
return loadSDKLibrary;
}
}

View File

@@ -54,12 +54,12 @@ spring.data:
## Redis 配置(单机模式)
redis:
# 地址
host: ${REDIS_HOST:192.168.2.30}
# host: ${REDIS_HOST:127.0.0.1}
# host: ${REDIS_HOST:192.168.2.30}
host: ${REDIS_HOST:127.0.0.1}
# 端口(默认 6379
port: ${REDIS_PORT:6379}
# 密码(未设置密码时请注释掉)
password: ${REDIS_PWD:redis2025}
# password: ${REDIS_PWD:redis2025}
# 数据库索引
database: ${REDIS_DB:0}
# 连接超时时间