1. 程式人生 > 其它 >apache-maven 上傳到本地私服deploy報錯

apache-maven 上傳到本地私服deploy報錯

技術標籤:BUGmavenSpringmavenbug後端apache

異常描述

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project maven_day02_dao: Failed to deploy artifacts: Could not transfer artifact cn.bloghut:maven_day02_dao:jar:1.0-20210209.111041-1 from/to snapshots (http://localhost:8081/nexus/content/repositories/snapshots/): Failed to transfer file http://localhost:8081/nexus/content/repositories/snapshots/cn/bloghut/maven_day02_dao/1.0-SNAPSHOT/maven_day02_dao-1.0-20210209.111041-1.jar with status code 401 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

異常描述

異常原因

由於我要上傳jar包到本地私服,修改apache-maven settings.xml檔案,配置連線私服的使用者和密碼,修改 settings.xml檔案時把標籤配置錯誤,這才導致deploy報錯。

解決辦法

把 settings.xml檔案改正確即可