对于一些内部项目的jar,有时候不会放到maven库上去,那么idea中maven项目引入的第三方jar包,如何打入到要发布的包里面呢?两步,
1、pom中对关联项的依赖
注意 scope 设置为 system,systemPath 可设置第三方jar本地路径。

2、打包插件的配置
原springboot打包插件加了一个Configuration,

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</build>
IDEA Maven项目打包包含内部jar
本文介绍如何在IDEA中将Maven项目的内部jar包(未上传至Maven库)加入到发布的最终包中。通过设置pom.xml中的scope为system并指定本地路径,再配置spring-boot-maven-plugin插件的includeSystemScope参数为true,实现内部jar的正确打包。
1296

被折叠的 条评论
为什么被折叠?



