mvn -deploy 报错 Failed to deploy artifacts: Could not transfer artifact

问题报错:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project apollo: Failed to deploy artifacts: Could not transfer artifact com.ctrip.framework.ap
ollo:apollo:pom:0.8.0 from/to releases (http://192.168.1.43:8081/nexus/content/repositories/releases/): Failed to transfer file: http://192.168.1.43:8081/nexus/content/repositories/releases/com/ctrip/fra
mework/apollo/apollo/0.8.0/apollo-0.8.0.pom. Return code is: 401, ReasonPhrase: Unauthorized. -> [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
==== building client finished ====

问题分析:
很明显用户权限不足,按网上提供的解决办法:
http://www.iteye.com/problems/71458
这里写图片描述
修改nexus 的releases 下的Deployment Policy为allow redeploy 和用户deployment 的密码。
然而并没有什么用,还是报401.
mvn -X 这个命令查看当前生效的settings.xml是哪一个。

[DEBUG] Reading global settings from d:\apache-maven-3.3.9-bin\apache-maven-3.3.9\conf\settings.xml
[DEBUG] Reading user settings from C:\Users\Administrator\.m2\settings.xml

发现有2个settings.xml在在git bash里面其使用的是C盘用户目录下的,而C盘这里面的username首字母大写,导致无法连接,所以把安装目录下改好的配置文件复制到
C:\Users\Administrator.m2\下,问题解决。
参考
参考

  • 4
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值