场景:自有系统研发,需要调用第三方的接口,对方提供SDK的客户端调用方式,项目需要引用第三方的私有SDK
1、如果只是本地启动项目,只需要在ideal中File -> Project Structure -> Modules -> Dependencies -> 添加jars 后build即可。
2、如果需要通过发布软件,自动下载依赖包的,私有包是无法获取到的。有2种方式解决
- 将私有包放到自己的私有仓库中,然后配置相应的pom文件即可
- 详细讲下第二种,不用和运维人员进行打交道,首先讲私有包放到项目的目录下,然后在启动类的添加以下,然后maven刷新下即可。
<dependency> <groupId>com.google.gson</groupId> <artifactId>gson</artifactId> <version>2.8.0</version> <scope>system</scope> ------实际jar包的位置 <systemPath>${project.basedir}/lib/gson-2.8.0.jar</systemPath> </dependency> ------在plugins中添加 <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <includeSystemScope>true</includeSystemScope> </configuration> </plugin>