gpt4 book ai didi

java - Maven 构建失败,错误代码为 'ReasonPhrase:HTTPS Required'

转载 作者:行者123 更新时间:2023-12-01 06:00:37 26 4
gpt4 key购买 nike

使用maven构建Java项目时出错

[ERROR] Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1: Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.4.1 from/to central (http://repo.maven.apache.org/maven2): Failed to transfer file: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom. Return code is: 501 , ReasonPhrase:HTTPS Required. -> [Help 1]

最佳答案

由于 Maven 存储库不允许通过 http 加载 Artifact 构建失败,因为无法加载干净的插件对于我们来说,该解决方案将带有 httpS url 的 pluginRepository 添加到主 pom 文件

  <pluginRepositories>
<pluginRepository>
<id>central</id>
<url>https://repo.maven.apache.org/maven2/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

关于java - Maven 构建失败,错误代码为 'ReasonPhrase:HTTPS Required',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60528723/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com