上传jar包到公司maven nexus私服及踩坑排查

1. 上传

 mvn deploy:deploy-file "-DgroupId=com.dm" "-DartifactId=DmJdbcDriver18" "-Dversion=1.8" "-Dpackaging=jar" "-Dfile=C:\dameng\drivers\jdbc\DmJdbcDriver18.jar" "-Durl=http://192.168.0.1:30102/repository/ge-releases/" "-DrepositoryId=ge-releases"

参数说明:

mvn deploy:deploy-file
-DgroupId=xxxxxx 就相当于pom中的groupId
-DartifactId=xxxxxx	就相当于pom中的artifactId
-Dversion=xxxxxx	就相当于pom中的版本号version
-Dpackaging=xxxxxx	就相当于pom中打包方式
-Dfile=xxxxxx	本地环境
-Durl=xxxxxx	上传的url
-DrepositoryId=xxxxxx	对应的是setting.xml 里边的id

其中url就是settings中配置的url地址

2. 问题1:

Failed to deploy artifacts: Could not transfer artifact com.dm:DmJdbcDriver18:jar:1.8 from/to ge-releases (http://192.168.0.82:30102/repository/ge-public): Failed to transfer file: http://192.168.0.82:30102/repository/ge-public/com/dm/DmJdbcDriver18/1.8/DmJdbcDriver18-1.8.jar. Return code is: 405, ReasonPhrase: PUT.

这是因为没有选用hosted类型的nexus仓库。如图:我们之前用的ge-public,是group类型的,所以报错。

在这里插入图片描述

hosted类型的仓库专门存放公司自建jar包,proxy仓库专门负责下载开源的包。

3. 问题2:

上传成功后,发现项目中还是无法拉取,这是因为settings的配置中原来只配置了ge-public,没有配置ge-releases
在这里插入图片描述

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值