背景
对接快递助手的物流轨迹追踪功能,其官方提供了JavaSDK,但是并没有把其上传到maven公共库,也就导致我们无法很舒服的使用maven方式直接引入项目。
jar文件名称为:kdzs-open-api-sdk-20211119.jar
解决
方案一 可以自己把jar文件上传的maven私服。
初创团队还未搭建maven私服,故没使用这个方式
方案二 使用maven scope system
第一步: jar包存储位置如图所示:
第二步:pom引入依赖方式如下
重点是
scope
,systemPath
<dependency>
<groupId>com.kdzs</groupId>
<artifactId>kdzs-open-api-sdk</artifactId>
<version>20211119</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/kdzs-open-api-sdk-20211119.jar</systemPath>
</dependency>
第三步:设置打包时包含SystemScope,否则打包的时候这个jar将被忽略
重点是
<includeSystemScope>true</includeSystemScope>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
</build>
原文地址:https://blog.csdn.net/abu935009066/article/details/121749088
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。