[英]Error opening connection java.io.IOException: Server returned HTTP response code: 501 for URL
[get] Error opening connection java.io.IOException: Server returned HTTP response code: 501 for URL: http://repo1.maven.org/maven2/org/apache/maven/maven-ant-tasks/2.1.3/maven-ant-tasks-2.1.3.jar
I'm getting this error while installing thrift-0.9.3(Apache Ant(TM) version 1.9.9).安装 thrift-0.9.3(Apache Ant(TM) 版本 1.9.9)时出现此错误。 I know that effective January 15, 2020, The Central Repository no longer supports insecure communication over plain HTTP and requires that all requests to the repository are encrypted over HTTPS, so I will have to change http with https.
我知道从 2020 年 1 月 15 日起,中央存储库不再支持通过普通 HTTP 进行的不安全通信,并要求对存储库的所有请求都通过 HTTPS 加密,因此我必须将 http 更改为 https。
I tried placing the required configuration inside /etc/maven/setting.xml but it did not work.我尝试将所需的配置放在 /etc/maven/setting.xml 中,但没有奏效。
Any help will be appreciated.任何帮助将不胜感激。
Recent versions of Maven (eg 3.6.0) will already use HTTPS as default. Maven 的最新版本(例如 3.6.0)已经默认使用 HTTPS。 So upgrading Maven to a recent version will fix this problem.
因此,将 Maven 升级到最新版本将解决此问题。
As an alternative, you can configure an older Maven version to use the canonical HTTPS endpoints, as specified by Sonatype :作为替代方案,您可以配置旧的 Maven 版本以使用由 Sonatype 指定的规范 HTTPS 端点:
https://repo1.maven.org
or https://repo.maven.apache.org
https://repo1.maven.org
或https://repo.maven.apache.org
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.