当前位置: 代码迷 >> 综合 >> maven deploy报错:Return code is: 401, ReasonPhrase: Unauthorized. -
  详细解决方案

maven deploy报错:Return code is: 401, ReasonPhrase: Unauthorized. -

热度:91   发布时间:2024-01-12 17:36:34.0

Return code is: 401, ReasonPhrase: Unauthorized. ->

解决方法:

  1. 在maven的settings.xml 文件中 添加
<servers><server><id>releases</id><username>admin</username><password>admin123</password></server><server><id>snapshots</id><username>admin</username><password>admin123</password></server></servers>
  1. 项目的pom文件添加:
<distributionManagement><repository><id>releases</id><url>http://nexus.local.com/content/repositories/thirdparty</url></repository><snapshotRepository><id>snapshots</id><url>http://nexus.local.com/content/repositories/snapshots/</url></snapshotRepository></distributionManagement>

注意 pom文件的id 要和在 maven中配置的server的id 一致 否则不起作用

然后就deploy成功了

参考博客:
https://blog.csdn.net/a15835774652/article/details/80354602

  相关解决方案