?1. 安装到本地仓库
mvn install:install-file -Dfile=D:\XX.jar -DgroupId=XX -DartifactId=XX -Dversion=1.11 -Production -Dpackaging=jar
2.dependency中指定scope="system"和本地jar包路径
(1)配置本地jar包依赖(systemPath指向本地jar包路径):
<dependency>
<groupId>XX</groupId>
<artifactId>XX</artifactId>
<version>1.11</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/xxx.jar</systemPath>
</dependency>
?(2)在<build>的spring-boot-maven-plugin中设置将本地jar包导出到项目最终的依赖库中:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>