背景
公司多模块的项目,需要打包一些第三方的jar到项目中去
方案
- 在模块目录下创建lib
2. 右键添加到classpath
3. 查看pom属性
4. pom文件中增加依赖
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcomponents-asyncclient</artifactId>
<version>4.0.2</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/httpasyncclient-4.0.2.jar</systemPath>
</dependency>
- pom 文件中的resource模块增加下边设置,指定位置的jar打进包中
<resource>
<directory>${pom.basedir}/lib</directory>
<targetPath>BOOT-INF/lib/</targetPath>
<includes>
<include>**/*.jar</include>
</includes>
</resource>
- 其他模块需要的话,可以在模块设置中增加进去