有如下依赖
<dependency>
<groupId>kim.nzxy</groupId>
<artifactId>some-name</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/some-name-1.0.0.jar</systemPath>
</dependency>
此时正常打包是无法运行的, 如果是springboot环境, 可以尝试添加includeSystemScope配置:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring-boot.version}</version>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
如果是多模块项目, 在main方法所在的模块里面添加includeSystemScope即可, 其余模块不必添加
非springboot项目则需要配置resource:
<build>
<resources>
<resource>
<!-- 值为当前pom.xml的相对路径 -->
<directory>lib</directory>
<!-- 要copy的目标路径 -->
<targetPath>/BOOT-INFO/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
</resources>
</build>