无法执行目标org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy default-deploy on project [英] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy default-deploy on project

查看:1792
本文介绍了无法执行目标org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy default-deploy on project的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[错误]无法在项目上执行目标org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy(默认部署). 无法部署工件:无法传输工件返回代码为:401,ReasonPhrase:未经授权. -> [帮助1]

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project. Failed to deploy artifacts: Could not transfer artifactReturn code is: 401, ReasonPhrase: Unauthorized. -> [Help 1]

自上次成功构建以来,未进行任何更改. 我仔细检查了settings.xml(用户名和密码).还检查了pom.xml(分发管理)

There was no changes made since last successful build. I double check settings.xml(username and password).Also check in pom.xml(distribution management)

自最近两天以来,我一直在研究此问题.我浏览了所有论坛,但没有任何帮助.请帮帮我.

I working on this issue since last 2 days.I gone through all the forum,nothing works.please help me out.

推荐答案

此错误消息表示您的计算机未正确向Nexus计算机进行身份验证.从Maven发送到Nexus的凭据不正确.

This error message means your machine is not authenticating correctly to the Nexus machine. The credentials sent to Nexus from Maven are not correct.

收到此消息后,通常必须查看我的settings.xml以验证此部分中的正确凭据.用户名和密码必须与Nexus本身中设置的正确.

When I have gotten this message, I usually have to look in my settings.xml to verify the proper credentials in this part. The username and password have to be the right ones as set in Nexus itself.

<servers>
    <server>
        <id>nexus-releases</id>
        <username>fillin</username>
        <password>fillin</password>
    </server>
</servers>

我通常会进入Nexus GUI并尝试使用这些凭据登录以验证它们,但是可以配置可以通过mvn发布但不能登录到GUI的凭据.

I usually go the Nexus GUI and try to log in with those credentials to verify them but it is possible to configure credentials that can publish via mvn but not log into the GUI.

一个可能的问题是,如果您使用依赖关系管理来确定在"mvn deploy"目标的情况下进行部署的位置.有这样的部分:

One possible problem is if you are using dependency-management to identify where to deploy in case of "mvn deploy" target. There is a section like this:

<distributionManagement>
    <repository>
        <id>nexus-releases</id>
        <name>releases</name>
        <url>http://myNexus/more/stuff</url>
    </repository>
</distributionManagement>

,并且ID字段必须与settings.xml中凭据上的ID匹配.如果ID不匹配,则会出现此错误.

and the id field has to match the the id on the credentials in the settings.xml. If the ids don't match, you will get this error.

另一个可能的问题是,如果您正在对pom.xml中的maven-deply-plugin使用执行,则可能具有配置属性

Another possible problem is that if you are using an execution for the maven-deply-plugin in your pom.xml, you might have the configuration property

<repositoryId>nexus-releases</repositoryId> 

同样,它与settings.xml中的ID不匹配,因此它因您的错误而失败.

and again it doesn't match the id in the settings.xml so it fails with your error.

类似地,如果使用看起来像这样的"mvn"命令上的命令行选项进行部署

Similarly, if deploying using the command line option on the "mvn" command that looks like this

-DrepositoryId=nexus-releases

与settings.xml中的ID不匹配,同样,它将无法正常工作.

doesn't match the id in the settings.xml, again, it won't work.

这篇关于无法执行目标org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy default-deploy on project的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆