- 与src目录同级新建lib目录
- 在pom中引用
<dependency>
<groupId>com.xxx.yyy</groupId>
<artifactId>xxx-jdk15</artifactId>
<version>2.0.29</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/xxx-jdk15.jar</systemPath>
</dependency>
- 最后别忘了最后的build标签
<includeSystemScope>true</includeSystemScope>
如果不加的话, 编译器运行没问题, 但是打包会缺失这个jar包
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
</build>