maven deploy到nexus报错:Return code is: 401, ReasonPhrase:Unauthorized
2016-06-22 14:42
477 查看
http://blog.csdn.net/happyteafriends/article/details/8174110
提交到nexus时候报错:
[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 artifact *:jar:1.0 from/to releases (http://10.1.81.199:8081/nexus/content/repositories/releases/): Failed to transfer file: http://10.1.81.199:8081/nexus/content/repositories/releases/com/cs2c/security-management-client* /1.0/*-1.0.jar.
Return code is: 401, ReasonPhrase:Unauthorized.
原来是没有配置认证。
maven目录conf的setting.xml里,
[html]
view plain
copy
print?
<server>
<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
用户名和密码都是nexus的。再次deploy即可。
注意这里的id要和pom.xml里远程deploy的地址对应一致,我的pom.xml里配置:
[html]
view plain
copy
print?
<!-- 配置远程发布到私服,mvn deploy -->
<distributionManagement>
<repository>
<id>releases</id>
<name>Nexus Release Repository</name>
<url>http://10.1.81.199:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://10.1.81.199:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
如果这里不配置,会报错:
报错:Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy
(default-deploy) on project
Git-demo: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter
提交到nexus时候报错:
[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 artifact *:jar:1.0 from/to releases (http://10.1.81.199:8081/nexus/content/repositories/releases/): Failed to transfer file: http://10.1.81.199:8081/nexus/content/repositories/releases/com/cs2c/security-management-client* /1.0/*-1.0.jar.
Return code is: 401, ReasonPhrase:Unauthorized.
原来是没有配置认证。
maven目录conf的setting.xml里,
[html]
view plain
copy
print?
<server>
<id>releases</id>
<username>admin</username>
<password>admin123</password>
</server>
<server>
<id>snapshots</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
用户名和密码都是nexus的。再次deploy即可。
注意这里的id要和pom.xml里远程deploy的地址对应一致,我的pom.xml里配置:
[html]
view plain
copy
print?
<!-- 配置远程发布到私服,mvn deploy -->
<distributionManagement>
<repository>
<id>releases</id>
<name>Nexus Release Repository</name>
<url>http://10.1.81.199:8081/nexus/content/repositories/releases/</url>
</repository>
<snapshotRepository>
<id>snapshots</id>
<name>Nexus Snapshot Repository</name>
<url>http://10.1.81.199:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>
如果这里不配置,会报错:
报错:Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.5:deploy
(default-deploy) on project
Git-demo: Deployment failed: repository element was not specified in the POM inside distributionManagement element or in -DaltDeploymentRepository=id::layout::url parameter
相关文章推荐
- android中压缩图片的几种方法比较
- mysql5.7数据库安装完成后如何配置环境变量
- java设计模式-单例模式
- Windows下定制编译QtWebEngine
- 简单所以不要忽视,关于\r\n和\n程序员应了解的实际应用
- ST Visual Programmer批量烧写教程
- 解决高并发
- CLI/C++中混合类的使用【转】
- iOS RunLoop简介
- nginx编译安装
- 突破python缺陷,实现几种自定义线程池 以及进程、线程、协程的介绍
- 查找-第9章-《数据结构题集》习题解析-严蔚敏吴伟民版
- 设置Dialog全屏,背景使用Dialog布局颜色
- scaletype之centerInside,center,centerCrop,fitCenter之间的区别
- Retrofit 上传多张图片/文件
- java 继承 讲解
- 华为的java面试题
- Check failed: status == CUBLAS_STATUS_SUCCESS (11 vs. 0) CUBLAS_STATUS_MAPPING_ERROR
- gulp在项目中的使用
- Sigmoid Function