Maven Central Repository is moving to HTTPS and disablig HTTP access


If you are getting the following error when you are building your Java project using maven or gradle
Failed to transfer file:<some/dependency/artifact>.pom Return code is: 501 , ReasonPhrase:HTTPS Required.

And you are thinking what happened, I haven’t changed anything in my project, no new dependencies, or repositories. The answers is that, you haven’t changed anything.

Do not panic! Effective January 15, 2020, the Central Repository is not longer supporting communication over HTTP and it requires requests to the repository must be over HTTPS.

What Do I need to do ?

The solution is very easy, you just need to replace the urls to maven central repository (and maybe other main repositories) to https instead of http. That’s all!!!



In case, you have never defined the repositories url and you are using the default values, you just need to add the new repositories with https.

How to add new repositories ?


There are 2 options, you can do it in your project’s pom.xml file or you can do it in settings.xml file.

    <id>central maven repo</id>
    <name>central maven repo https</name>

For settings.xml file, you will need to create a profile and add the above code into that profile. Remember to activate that profile.

I prefer the option of adding the repository into my pom.xml in the project.

What about Gradle?

Since gradle also uses the Maven Central Repository, you will need to update the values in the repository:

repositories {
   maven { url "" }

Other Repositories that will disable HTTP

These are some other repositories the are also moving to https.

Spring (Pivotal) January 15, 2020
Gradle January 15, 2020
JFrog Bintray January 13, 2020




Leave a Reply

Your email address will not be published. Required fields are marked *