下面分享引用本地jar与打包本地jar,总结起来很简单,分3步:
1.在项目资源目录下创建一个文件夹,用来存放 本地jar包
2.在pom.xml中添加 本地jar包的引用,引用目录为第一步创建的文件目录
3.在pom.xml的plugins中添加编译打包的目录,使本地jar包能打到项目中去
先准备好本地jar包,然后在项目的resources目录创建 lib 目录,把本地jar包放进 lib 下
<dependencies>
<dependency>
<groupId></groupId>
<artifactId></artifactId>
<version></version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/lib/netcdfAll-5.5.2.jar</systemPath>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<includeSystemScope>true</includeSystemScope>
</configuration>
</plugin>
</plugins>
</build>