当前位置:   article > 正文

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

return code is: 400, reasonphrase: bad request
  1. [INFO] ------------------------------------------------------------------------
  2. [INFO] BUILD FAILURE
  3. [INFO] ------------------------------------------------------------------------
  4. [INFO] Total time: 3.254 s
  5. [INFO] Finished at: 2019-12-01T18:10:10+08:00
  6. [INFO] Final Memory: 13M/181M
  7. [INFO] ------------------------------------------------------------------------
  8. [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]
  9. [ERROR]
  10. [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  11. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  12. [ERROR]
  13. [ERROR] For more information about the errors and possible solutions, please read the following articles:
  14. [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  15. Process finished with exit code 1

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

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

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

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

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

参考:

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

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

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小舞很执着/article/detail/837126
推荐阅读
相关标签
  

闽ICP备14008679号