参考:idea maven 导入lib中jar 并打包_maven引入lib中的jar包-优快云博客
解决办法,只需要在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>

文章介绍了如何在Maven项目中处理系统范围依赖的jar包,通过在pom.xml的<build>部分添加<includeSystemScope>配置,允许将指定的jar包打包,如SpringBoot项目中排除Lombok。
3697





