jar包手动添加到本地maven仓库详解

2年前 (2022) 程序员胖胖胖虎阿
332 0 0

第一步:下载需要添加的jar包

可以在maven库中查找下载,也可以在对应官网下载

maven库网址:https://mvnrepository.com/jar包手动添加到本地maven仓库详解

第二步:将下载的jar包放到指定位置(位置自己指定,用得到),建议放在maven的repository路径下,方便管理

jar包手动添加到本地maven仓库详解

第三步:配置本地maven库

1.首先检查本地maven库环境变量是否配置正确

打开cmd ,执行 mvn -h   查看maven的环境变量是否配置正确

jar包手动添加到本地maven仓库详解

如果不是上图显示,在path 中添加 自己的maven的bin 的路径 例如:D:\maven\apache-maven-3.6.1\bin;

 jar包手动添加到本地maven仓库详解

 2. 进入cmd,进入之前存放jar包的路径

window命令举例:

d:   ---进入d盘

cd filename   ---进入filename文件夹

我这里进入的是D:\maven\apache-maven-3.6.1\repository
     jar包手动添加到本地maven仓库详解

3.执行(执行的内容根据自己情况修改)

mvn install:install-file -DgroupId=io.confluent -DartifactId=kafka-schema-registry-client -Dversion=4.1.1 -Dpackaging=jar -Dfile=kafka-schema-registry-client-4.1.1.jar

参数说明:

-DgroupId:表示jar对应的groupId     

<groupId>io.confluent</groupId>

-DartifactId: 表示jar对应的artifactId

<artifactId>kafka-schema-registry-client</artifactId>

-Dversion: 表示jar对应的 version

<version>4.1.1</version>

最后显示:build success

jar包手动添加到本地maven仓库详解

 重新加载pom.xml文件就好了

版权声明:程序员胖胖胖虎阿 发表于 2022年10月6日 上午7:48。
转载请注明:jar包手动添加到本地maven仓库详解 | 胖虎的工具箱-编程导航

相关文章

暂无评论

暂无评论...