前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >解决: Failed to execute ... maven-deploy-plugin... Return code is: 401, ReasonPhrase: Unauthorized.

解决: Failed to execute ... maven-deploy-plugin... Return code is: 401, ReasonPhrase: Unauthorized.

作者头像
微风-- 轻许--
发布2019-08-01 14:47:53
4.3K0
发布2019-08-01 14:47:53
举报
文章被收录于专栏:java 微风java 微风

1. 执行 mvn clean deploy , 想把本地代码 打包并推送到私服 ,报错:

代码语言:javascript
复制
[ERROR] Failed to execute goal org.apache.maven.plugins:
maven-deploy-plugin:2.8.2:deploy (default-deploy) on project client-one:
 Failed to deploy artifacts: Could not transfer artifact com.client:
client-one:jar:0.0.1
-20190717.055439-1 from/to maven-snapshots 
(http://ergouzi.fun:8081/repository/maven-snapshots/):
 Failed to transfer file: 
xxx/repository/maven-snapshots/com/client/client-one/0.0.1-SNAPSHOT/xxx.jar. 
Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]

2. 原因:

setting.xml 中配置的 id 一定要和 pom.xml 中 配置的 id 一致。

setting.xml 中配置的 id 如下:

pom.xml 中 配置的 id 如下:

在 pom.xml 中有以上配置后,可不用再加此配置:

只要 id 对应上了,账号密码无误,就可以 deploy 成功了。

PS: 我还有个小原因,前面一直找错了 setting.xml 文件。我电脑中有多份,因为熟悉位置,就一直以为就是 A 位置的,最后才发现是用的 B 位置的。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2019年07月17日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档