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

Maven deploy:Return code is: 401, ReasonPhrase: Unauthorized

热度:57   发布时间:2023-12-17 11:38:11.0

1. 检查项目maven设置,默认在.m2下,确保这个目录下setting.xml存在。

2.setting.xml中的2种账号releases和snapshots与项目pom中保持一致:

setting.xml:

<server>
      <id>releases</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
    <server>
      <id>snapshots</id>
      <username>admin</username>
      <password>admin123</password>
    </server>

pom.xml:

  <distributionManagement>
    <repository>
      <id>releases</id>
      <url>http://ip:port/nexus/content/repositories/releases/</url>
    </repository>
    <snapshotRepository>
      <id>snapshots</id>
      <url>http://ip:port/nexus/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>

  相关解决方案