项目发布到maven私服报错:Return code is: 400, ReasonPhrase: Bad Request.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.254 s
[INFO] Finished at: 2019-12-01T18:10:10+08:00
[INFO] Final Memory: 13M/181M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on project demo: Failed to deploy artifacts: Could not transfer artifact com.addoclass:demo:jar:1.0-20191201.101010-1 from/to xdclass (http://localhost:8081/nexus/content/repositories/xdclass): Failed to transfer file: http://localhost:8081/nexus/content/repositories/xdclass/com/addoclass/demo/1.0-SNAPSHOT/demo-1.0-20191201.101010-1.jar. Return code is: 400, ReasonPhrase: Bad Request. -> [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

Process finished with exit code 1

网上找到的报错原因以及解决方法有两种:

1:上传的jar包之前部署到maven私有库过,而maven私有库上设置不允许重新部署;

将部署策略改为允许重新部署。

2:项目的pom.xml配置文件中,version中包含了-SNAPSHOT,所以repository policy:release发布不了,将SNAPSHOT删除。(我是因为这个原因)

    <groupId>com.addoclass</groupId>
    <artifactId>demo</artifactId>
    <version>1.0-SNAPSHOT</version>

参考:

https://blog.csdn.net/running_snail_/article/details/19821777

https://blog.csdn.net/superyu1992/article/details/84063437

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值