maven deploy上传私服出错

本文记录了使用Maven部署过程中遇到的问题及解决方法。主要问题是部署到Nexus仓库时返回401错误代码,最终通过调整Nexus设置及验证用户密码得以解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:
deploy (default-deploy) on project ftadStatDao: Failed to deploy artifacts: Coul
d not transfer artifact com.ftad.common.stat.dao:ftadStatDao:jar:1.0-20110907.02
0427-1 from/to nexus-snapshot (http://xx.xxx:8081/nexus/content/repositori
es/snapshots): Failed to transfer file: http://xx.xxx:8081/nexus/content/r
epositories/snapshots/com/ftad/common/stat/dao/ftadStatDao/1.0-SNAPSHOT/ftadStat
Dao-1.0-20110907.020427-1.jar. Return code is: 401 -> [Help 1]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[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 rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception


我的配置

<server>
<id>nexus-releases</id>
<username>deployment</username>
<password>deployment123</password>
</server>
<server>
<id>nexus-snapshots</id>
<username>deployment</username>
<password>deployment1234</password>
</server>

pom.xml

<distributionManagement>
<!-- <repository>
<id>thirdparty</id>
<url>http://xx:8081/nexus/content/repositories/thirdparty</url>
</repository>
-->
<repository>
<id>nexus</id>
<name>Team Nexus Release Repository</name>
<url>http://xx:8081/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>nexus-snapshot</id>
<name>Team Nexus Snapshot Repository</name>
<url>http://xx:8081/nexus/content/repositories/snapshots</url>
<uniqueVersion>false</uniqueVersion>
</snapshotRepository>

</distributionManagement>


不容易在baidu和google的帮助下终于解决了
需要修改nexus 的releases 下的Deployment Policy为allow redeploy 和用户deployment 的密码
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值