从Maven在关系中部署工件会产生错误“返回码为:401"? [英] Deploying artifacts in nexus from maven gives error "Return code is: 401"?
本文介绍了从Maven在关系中部署工件会产生错误“返回码为:401"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在nexus部署时出现401错误.我不对已安装的关系进行任何更改. Nexus在localhost:8080/nexus
上运行,我能够使用默认用户名/密码登录.当我运行mvn deploy
时,出现此错误.
I am getting 401 error while deploying in nexus. I does not make any changes to the installed nexus. Nexus is running on localhost:8080/nexus
and i am able to login with default user/password. When i am running mvn deploy
i am getting this error.
这是我的POM.
<groupId>testproject</groupId>
<artifactId>testproject</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>testproject</name>
<url>http://maven.apache.org</url>
<distributionManagement>
<repository>
<id>releases</id>
<url>http://localhost:8080/nexus/content/repositories/releases</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<url>http://localhost:8080/nexus/content/repositories/snapshots</url>
</snapshotRepository>
</distributionManagement>
<dependencies>
.........
</dependencies>
和〜/.m2/settings.xml
and ~/.m2/settings.xml
<servers>
<server>
<id>snapshots</id>
<username>deployment</username>
<password>deployment123</password>
</server>
<server>
<id>releases</id>
<username>deployment</username>
<password>deployment123</password>
</server>
</servers>
例外:
Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default- deploy) on project testproject: Failed to deploy artifacts: Could not transfer artifact testproject:testproject:jar:1.0-20131213.150615-1 from/to snapshots (http://localhost:8080/nexus/content/repositories/snapshots): Failed to transfer file: http://localhost:8080/nexus/content/repositories/snapshots/testproject/testproject/1.0-SNAPSHOT/testproject-1.0-20131213.150615-1.jar.
Return code is: 401 -> [Help 1]
请帮助我.
推荐答案
它现在正在工作.需要编辑${MVN_HOME}/conf/settings.xml
而不是/home/{user}/.m2/settings.xml
It's working now. Need to edit ${MVN_HOME}/conf/settings.xml
instead of /home/{user}/.m2/settings.xml
这篇关于从Maven在关系中部署工件会产生错误“返回码为:401"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文