使用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文件的<servers></servers>中配置一个server,配置内容如下:

    <server>
      <id>snapshots</id><!--此处的id要与nexus中的仓库id和pom中配置的repository id保持一致-->
      <username>admin</username>
      <password>admin123</password>
    </server>

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值