使用Maven Deploy项目到Nexus时报错:Return code is: 401, ReasonPhrase: Unauthorized

一、问题描述

今天在使用Maven命令:mvn deploy将项目部署到nexus中时报错如下:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project maibao-parent: Failed to deploy artifacts: Could not transfer artifact com.mengfei:maibao-parent:pom:1.0-20180813.090224-1 from/to central (http://192.168.188.132:8081/nexus/content/groups/public): Failed to transfer file: http://192.168.188.132:8081/nexus/content/groups/public/com/mengfei/maibao-parent/1.0-SNAPSHOT/maibao-parent-1.0-20180813.090224-1.pom. Return code is: 401, ReasonPhrase: Unauthorized.

二、问题原因

没有得到nexus的认证授权,即账号、密码不正确或者根本没有配置

三、解决问题

nexus的默认账号为:admin,默认密码为:admin123

如果没有配置的请在setting.xml文件的中配置一个server,配置内容如下:

    
      snapshots
      admin
      admin123
    

使用Maven Deploy项目到Nexus时报错:Return code is: 401, ReasonPhrase: Unauthorized_第1张图片

参考: https://blog.csdn.net/li396864285/article/details/73530321

你可能感兴趣的:(异常或错误收集)