为了账号安全,请及时绑定邮箱和手机立即绑定

使用nexus搭建的私仓,将jar上传到3rdParty时报错,如何解决?

使用nexus搭建的私仓,将jar上传到3rdParty时报错,如何解决?

www说 2019-03-01 10:47:21
mvn deploy:deploy-file -DgroupId=chinapay -DartifactId=chinapayfilesecure -Dversion=1.0 -Dpackaging=jar -Dfile=E:\repo\repository1\chinapay\chinapayfilesecure\1.0\chinapayfilesecure-1.0.jar -Durl=http://localhost:8081/repository/3rdParty/ -DrepositoryId=3rdParty E:\repo\repository1\chinapay\chinapaysecure\1.0>mvn deploy:deploy-file -DgroupId=chinapay -DartifactId=chinapayfilesecure -Dversion=1.0 -Dpackaging=jar -Dfile=E:\repo\repository1\chinapay\chinapayfilesecure\1.0\chinapayfilesecure-1.0.jar -Durl=http://localhost:8081/repository/3rdParty/ -DrepositoryId=3rdParty [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-deploy-plugin:2.7:deploy-file (default-cli) @ standalone-pom --- Uploading: http://localhost:8081/repository/3rdParty/chinapay/chinapayfilesecure/1.0/chinapayfilesecure-1.0.jar Uploading: http://localhost:8081/repository/3rdParty/chinapay/chinapayfilesecure/1.0/chinapayfilesecure-1.0.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.685 s [INFO] Finished at: 2017-07-17T17:42:30+08:00 [INFO] Final Memory: 9M/155M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy-file (default-cli) on project standalone-pom: Failed to deploy artifacts: Could not transfer artifact chinapay:chinapayfilesecure:jar:1.0 from/to 3rdParty (http://localhost:8081/repository/3rdParty/): Failed to transfer file: http://localhost:8081/repository/3rdParty/chinapay/chinapayfilesecure/1.0/chinapayfilesecure-1.0.jar. Return code is: 401, ReasonPhrase: Unauthorized. -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [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 read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException E:\repo\repository1\chinapay\chinapaysecure\1.0>
查看完整描述

2 回答

?
慕婉清6462132

TA贡献1804条经验 获得超2个赞

已经解决,只要在maven的配置文件里面添加 这一行就可以了。

 <server>  
            <id>3rdParty</id>  
            <username>admin</username>  
            <password>admin123</password>  
        </server> 
查看完整回答
反对 回复 2019-03-01
  • 2 回答
  • 0 关注
  • 605 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号