Maven Dependencies Are Failing With a 501 Error

Maven dependencies are failing with a 501 error

The reason for the observed error is explained in Central 501 HTTPS Required

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.

It looks like latest versions of Maven (tried with 3.6.0, 3.6.1) are already using the HTTPS URL by default.

Here are the dates when the major repositories will switch:

Your Java builds might break starting January 13th (if you haven't yet switched repo access to HTTPS)

Update: Seems like from maven 3.2.3 maven central is accessed via HTTPS
See https://stackoverflow.com/a/25411658/5820670

Maven Change log
(http://maven.apache.org/docs/3.2.3/release-notes.html)

ailed to transfer http://repo.maven.apache.org/maven2 - Error code 501, HTTPS Required

I believe the error is as it says: it does not support unencrypted requests. So we should change your URL to HTTPS.

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

and if you cannot use HTTPS for some reason, then use:

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

for Maven repos.

Just did a quick search, and found some references if you would like more information:

Maven dependencies are failing with a 501 error

Since you are having a bit of a problem reading through that, you need to update your pom.xml file I believe and update your maven URL. It should look something like this, or use similar logic for updating with the specific URL above (hard to post an example of that without your POM file portion of it).

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

MAVEN couldn't resolve the dependencies

Your logging artifact seems to be incorrect. Can you try this:

<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>

You can confirm this path here:
https://repo.maven.apache.org/maven2/org/apache/logging/log4j/log4j-core/2.13.0/

Also see:
https://logging.apache.org/log4j/2.x/maven-artifacts.html



Related Topics



Leave a reply



Submit