问题:
项目中使用 systemPath 引用第三方依赖,在打包后启动,提示NoClassDefFoundError错误,在本地环境运行时没有出现该问题,如下所示。
解决办法:
在pom文件中,spring-boot-maven-plugin 中配置 includeSystemScope 为 true即可,如下所示。
<configuration>
<fork>true</fork>
<includeSystemScope>true</includeSystemScope>
</configuration>