赞
踩
- [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
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。