maven:将第三方jar包上传到本地仓库或远程仓库

导入本地仓库

首先 CMD进入到 jar 包所在位置,运行

mvn install:install-file -DgroupId=xxx -DartifactId=xxx -Dversion=xxx -Dfile= xxx.jar -Dpackaging=jar

或打开cmd直接运行

mvn install:install-file -DgroupId=xxx -DartifactId=xxx -Dversion=xxx -Dpackaging=jar -Dfile=绝对路径.jar

导入远程仓库

要在 maven 软件的核心配置文件 settings.xml 中配置第三方仓库的 server 信息

 <server> 
 	<id>thirdparty</id> 
 	<username>admin</username>
 	<password>admin123</password> 
 </server>

然后CMD进入到 jar 包所在位置,运行

mvn deploy:deploy-file -DgroupId=xxx -DartifactId=xxx -Dversion=xxx -Dpackaging=jar -Dfile=xxx.jar 
-Durl=http://localhost:8081/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty

或打开cmd直接运行

mvn deploy:deploy-file -DgroupId=xxx -DartifactId=xxx -Dversion=1.1.37 -Dpackaging=jar -Dfile=绝对路径.jar -Durl=http://localhost:8081/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值