在项目开发时有时我们需要引入一些在maven仓库中不存在的包,此时,我们需要在maven的pom.xml中添加如下依赖方法:
<dependency>
<groupId>com.pproc.dependency</groupId>
<artifactId>aeswithjec</artifactId>
<version>20171214</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/aeswithjec-20171214.jar</systemPath>
</dependency>
其中的scope指定使用自己的jar包
systemPath指定自己jar包的位置
${project.basedir}为项目的路径(项目名称的下级目录)
在完成上述的工作后还需要在build节点中新增如下配置,才能将jar包打入spring boot的lib中:
<resources>
<resource>
<directory>${project.basedir}/lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
<resource>
<directory>src/main/resources</directory>
<targetPath>BOOT-INF/classes/</targetPath>
</resource>
</resources>