idea中maven引入第三方jar打包报错dependencies.dependency.version for xxx:jar is missing.

idea中maven引入第三方jar 打包报错:' dependencies.dependency.version' for xxx:jar is missing. @ Line 105, column 21

最近公司要对接海康威视的人脸接口,拿到文档研究了一下,老规矩先导入外部开发包项目为springboot web项目,创建lib文件夹,将需要用到的jar包丢进去。

在这里插入图片描述
lib下这两个包是需要外部引用的jar包;
在这里插入图片描述
然后再 pom.xml 中添加配置,来引入lib中的jar包

<!-- 引入海康威视SDK -->
<dependency>
<groupId>cn.hk</groupId>
<artifactId>examples</artifactId>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/examples.jar</systemPath>
</dependency>

<dependency>
<groupId>cn.hk</groupId>
<artifactId>jna</artifactId>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/jna.jar</systemPath>
</dependency>

然后再plugins 中的maven打包插件加入 true

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>

部署配置好后,运行没有问题。
在这里插入图片描述
当代码敲完准备打包部署的时package报错在这里插入图片描述dependenc ies . dependency . version’ for cn. hk: exampLes:jar is missing. @ Line 105, column 21
dependencies . dependency . version’ for cn.hk:jna:jar is missing. @ line 111, column 21

这里是因为 jar包名称没有添加版本号 maven打包时版本不确定

修改jar包名称 :
在这里插入图片描述
然后依赖中添加对应的版本号信息

<dependency>
<groupId>cn.hkws</groupId>
<artifactId>examples</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${pom.basedir}/lib/examples-1.0.jar</systemPath>
</dependency>
<dependency>
<groupId>cn.hkws</groupId>
<artifactId>jna</artifactId>
<scope>system</scope>
<version>1.0</version>
<systemPath>${pom.basedir}/lib/jna-1.0.jar</systemPath>
</dependency>

再重新打包测试:

打包成功
在这里插入图片描述

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值