pom.xml中引入项目中的jar包(通过<scope>system</scope>依赖本地jar包)

<dependency> <groupId>com.hbis.infmgr</groupId> <artifactId>sign-utils</artifactId> <version>0.0.1</version> <!--此处忽略sonar警告,因报表组件是定制化的本地包,放到了项目目录内,所以需要通过system-scope引入--> <scope>system</scope> <systemPath>${project.basedir}/lib/infmgr-common-0.0.1.jar</systemPath> </dependency>
如果你仅仅是这么做了,在你使用SpringBoot打包插件生成jar包的时候,你会发现这个jar包不会被打进去,进而出现错误。
这个就需要在maven插接中配置一个includeSystemScope属性:
<plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <!--设置为true,以便把本地的system的jar也包括进来--> <includeSystemScope>true</includeSystemScope> </configuration> </plugin>

浙公网安备 33010602011771号