Cloud Manager CI/CD 管道中的构建步骤失败,并出现与以下内容类似的错误:
17:48:16,195 [main] [ERROR] [ERROR] Some problems were encountered while processing the POMs: [ERROR] Non-resolvable import POM: Could not transfer artifact org.junit:junit-bom:pom:5.4.1 from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file http://repo.maven.apache.org/maven2/org/junit/junit-bom/5.4.1/junit-bom-5.4.1.pom with status code 501 @ line 650, column 25
无法下载 Maven 中央存储库中的工件,并返回 501 错误。
2019 年 12 月 20 日,Apache 团队(repo.maven.apache.org 的所有者)宣布,从 2020 年 1 月 15 日开始,中央存储库将不再支持通过 HTTP 进行通信。任何访问 http://repo1.maven.org 和 http://repo.maven.apache.org/ 的尝试都将导致错误,用户需要更新其构建以解决对 HTTPS 的依赖关系。
更新 pom.xml 文件中的存储库 URL 以使用 HTTPS。内容如下:
<repositories> <repository> <id>central</id> <name>Central Repository</name> <url>https://repo.maven.apache.org/maven2</url> <layout>default</layout> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories>
登录到您的帐户