方案1:本地jar直接导入项目
1.在scr同级别下创建libs,将jar包复制进去
2.将jar依赖到项目
至此项目正常启动了;
3.项目打包时候还需要在pom文件加入:
<dependency>
<groupId>com.zq</groupId>
<artifactId>crypto</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/crypto.jar</systemPath>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
<fork>true</fork>
</configuration>
</plugin>
</plugins>
</build>
其中groupId,artifactId,version任意定义,scope固定
systemPath指的是本地jar在项目中的位置;${project.basedir}项目根目录
- 方案2:通过私服引入jar
此方案请参照:https://blog.csdn.net/qq3516744991/article/details/70836292