SpringBoot 框架,Maven打包,jar包非仓库包问题
最近系统有个需求,需要引入外部jar包,于是下载保存到系统代码中,pom文件如图所示:
遇到的问题:Maven在打包时,丢失这两个jar包,导致相关功能报错
解决思路有两个
其一:在打包后,直接把这两个文件拖入lib/包内部,切记压缩模式选择存储,如下图所示:
其二,打包的时候,直接设置pom文件打包范围,包含scope 是system的jar包,如图所示:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
如此,即可解决该问题。