gpt4 book ai didi

java - 无法传输 http ://repo. maven.apache.org/maven2 - 错误代码 501,需要 HTTPS

转载 作者:行者123 更新时间:2023-11-30 01:40:49 28 4
gpt4 key购买 nike

我有一个虚拟机,并且正在使用 spring 工具套件和 JDK7。

我已经从 git 下载了我的项目,但我在 pom.xml 中遇到错误:

Plugin org.apache.maven.plugins:maven-clean-plugin:2.5 or one of its dependencies could not be resolved: 
Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.5:
Could not transfer artifact org.apache.maven.plugins:maven-clean-plugin:pom:2.5 from/to central (http://repo.maven.apache.org/maven2):
Failed to transfer http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom. Error code 501, HTTPS Required

Mi pom.xml

        <plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<compilerArgument>-Xlint:all</compilerArgument>
<showWarnings>true</showWarnings>
<showDeprecation>true</showDeprecation>
</configuration>
</plugin>

已测试。删除.m2,maven clean,...

我需要改变什么?

最佳答案

我相信错误正如它所说:它不支持未加密的请求。因此,我们应该将您的 URL 更改为 HTTPS。

https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.5/maven-clean-plugin-2.5.pom

如果您由于某种原因无法使用 HTTPS,则使用:

http://insecure.repo1.maven.org/maven2/

对于 Maven 存储库。

刚刚进行了快速搜索,如果您想了解更多信息,找到了一些引用资料:

Maven dependencies are failing with a 501 error

由于您在阅读该内容时遇到了一些问题,因此我相信您需要更新您的 pom.xml 文件并更新您的 maven URL。它应该看起来像这样,或者使用类似的逻辑来更新上面的特定 URL(如果没有 POM 文件部分,很难发布这样的示例)。

<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>

关于java - 无法传输 http ://repo. maven.apache.org/maven2 - 错误代码 501,需要 HTTPS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60079911/

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