需要修改成如下配置
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
<!-- 增加此行,可以解决打包时,找不到jar包的问题-->
<addResources>true</addResources>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
这样就可以了。