原创

【腾讯云】记一次mvn deploy 报402错误的问题

前言

本人目前的博客站点代码仓库采用腾讯云旗下的 Coding 进行托管。日常会对部分代码进行修改并推送至仓库,随后执行自动构建,并自动发布至生产环境。Coding 表现较为稳健,在大多数情况下均能正常工作。待流程全部打通后,便可实现一键发布至生产环境,着实节省了不少事务。然而,问题也随之出现。

意外

coding提供了maven制品仓库的功能,能将打包出来的产品推送到仓库中,以便于协同开发。

构建失败截图

但今天却发现遇到了一个意外的构建失败。

查看日志发现,是maven推送到仓库的节点报错,因为默认的脚本是mvn deploy -s ./settings.xml -DskipTests只能简单的看到报错内容为

[2024-09-25 17:51:08] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project blog: Failed to deploy artifacts: Could not transfer artifact xxxxxxxxx from/to mvn仓库名 (https://仓库名.pkg.coding.net/repository/blog/mvnzpk/): Failed to transfer file: https://仓库名.pkg.coding.net/repository/pom文件名. Return code is: 402, ReasonPhrase: Payment Required. -> [Help 1]
[2024-09-25 17:51:08] [ERROR] 
[2024-09-25 17:51:08] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[2024-09-25 17:51:08] [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[2024-09-25 17:51:08] [ERROR] 
[2024-09-25 17:51:08] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[2024-09-25 17:51:08] [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

收集到两个信息:

  1. 报错代码是402
  2. 有一个解释异常的地址:http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

先看报错代码,搜索Return code is: 402, ReasonPhrase: Payment Required,没有看到什么有用的信息。

查看解释异常的地址,发现是说明,该异常代码非maven导致的。

这下子难道干瞪眼吗?

解决

经过一番搜索,终于解决,原来该报错是预期内的,因为白嫖版的coding提供的制品仓库容量有限,制品内容太大的话,存储空间会限制。

Maven deploys fail with error 402, stop working. This issue is caused by storage limitation, please expand that 2G to solve this issue. Please set up billing if you need more storage.

只要删除历史构建的制品就行啦。

制品信息

估计是我最近代码改动太多了,构建发生的太频繁。

不过我最近在写豆瓣阅读的信息获取功能,因为用的isbn图书信息获取接口有些信息没跟上,只能自己到豆瓣的网页上来获取。

参考

Maven deploys fail with error 402

maven deploy到私服有时间戳的问题

本文来自:【腾讯云】记一次mvn deploy 报402错误的问题-小码农,转载请保留本条链接,感谢!

温馨提示:
本文最后更新于 2024年09月26日,已超过 19 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我
正文到此结束
该篇文章的评论功能已被站长关闭
本文目录