在开发Spring Boot项目时我们时常要引入一些不在maven仓库的包,比如我用过的JNative又或者是swt,引用方式如下:
<dependency> <groupId>org.eclipse</groupId> <artifactId>swt</artifactId> <version>1.0</version> <scope>system</scope> <systemPath>${project.basedir}/lib/swt.jar</systemPath> </dependency>
默认情况下Spring Boot在package
时不会打包systemPath
,如果想在打包时一并引入,最简单且官方的方式如下:
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <includeSystemScope>true</includeSystemScope> </configuration> </plugin> </plugins> </build>
未经允许不得转载:鹞之神乐 » Spring Boot项目打包时一并引入systemPath