第一种方式:
构建后,pom里直接引入
mvn install:install-file --settings E:\mavenSetting\settings.xml -Dfile=httpcore-4.4.9.jar -DartifactId=httpcore-4.4.9 -DgroupId=org.apache.http -Dversion=4.4.9 -Dpackaging=jar -DgeneratePom=true
# --settings:指定maven配置文件
# -Dfile:本地jar包的相对路径或者绝对路径
# -DgroupId:jar包的组织id,也是需要安装的文件夹路径
# -DartifactId:包名
# -Dversion:版本号
#-Dpackaging:打包方式
#-DgeneratePom:是否生成依赖包POM文件
第二种方式:
将jar放到工程目录,pom里使用路径引入
<dependency>
<groupId>org.apache.http</groupId>
<artifactId>httpcore-4.4.9</artifactId>
<version>4.4.9</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/lib/httpcore-4.4.9.jar</systemPath>
</dependency>