参考:idea maven 导入lib中jar 并打包_maven引入lib中的jar包-CSDN博客
解决办法,只需要在pom文件中加入
<includeSystemScope>true</includeSystemScope>
<build>
<!-- <includeSystemScope>true</includeSystemScope>解决指定的jar包不能打包 -->
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>