解决: Failed to execute ... maven-deploy-plugin... Return code is: 401, ReasonPhrase: Unauthorized.
生活随笔
收集整理的這篇文章主要介紹了
解决: Failed to execute ... maven-deploy-plugin... Return code is: 401, ReasonPhrase: Unauthorized.
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
前些天發現了一個巨牛的人工智能學習網站,通俗易懂,風趣幽默,忍不住分享一下給大家。點擊跳轉到教程。
1. 執行? mvn? clean deploy , 想把本地代碼 打包并推送到私服 ,報錯:
[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 位置的。
?
總結
以上是生活随笔為你收集整理的解决: Failed to execute ... maven-deploy-plugin... Return code is: 401, ReasonPhrase: Unauthorized.的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: c#中将HTML文件转换成PDF文件
- 下一篇: c#中一个进程启动另一个进程并传递参数