gpt4 book ai didi

maven - 从maven在nexus中部署 Artifact 会产生 "Return code is: 401"错误?

转载 作者:行者123 更新时间:2023-12-04 04:59:29 28 4
gpt4 key购买 nike

在nexus部署时出现401错误。我不对已安装的关系进行任何更改。 Nexus在localhost:8080/nexus上运行,我可以使用默认用户名/密码登录。当我运行mvn deploy时,出现此错误。

这是我的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
<servers>
<server>
<id>snapshots</id>
<username>deployment</username>
<password>deployment123</password>
</server>
<server>
<id>releases</id>
<username>deployment</username>
<password>deployment123</password>
</server>
</servers>

异常(exception):
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

关于maven - 从maven在nexus中部署 Artifact 会产生 "Return code is: 401"错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20570009/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com