Abhishek Mishra
Abhishek Mishra

Reputation: 111

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

I tried placing the required configuration inside /etc/maven/setting.xml but it did not work.

Any help will be appreciated.

Upvotes: 0

Views: 2063

Answers (1)

Kevin Wittek
Kevin Wittek

Reputation: 1572

Recent versions of Maven (e.g. 3.6.0) will already use HTTPS as default. So upgrading Maven to a recent version will fix this problem.

As an alternative, you can configure an older Maven version to use the canonical HTTPS endpoints, as specified by Sonatype:
https://repo1.maven.org or https://repo.maven.apache.org

Upvotes: 1

Related Questions