在项目开发中不可避免会遇到引入第三方jar包的情况,这些第三方jar是在Maven仓库中没有的。
有两种处理方式:
- 将jar包安装在本地maven库(本地私服)
- 将jar包放入项目目录中。
常见的打包方式又分为两种,打成jar包或者打成war包。
1.打成jar包
假如我们的第三方jar放置在项目根路径下,即:
此时,我们在pom.xml中这么配置:
<!--本地开发的ILEDCloudSDK 其中groupId,artifactId,version自定义-->
<dependency>
<groupId>com.hidisp</groupId>
<artifactId>ILEDCloudSDK</artifactId>
<version>2.6</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/iLEDCloudSDK-2.6.jar</systemPath>
</dependency>
或者
和
<dependency>
<groupId>com.hidisp</groupId>
<artifactId>ILEDCloudSDK</artifactId>
<version>2.6</version>
<scope>system</scope>
<systemPath>${project.basedir}/lib/iLEDCloudSDK-2.6.jar</systemPath>
</dependency>
最后:
<build>
<plugins>
<plugin