karans123
karans123

Reputation: 836

Efficient Resolution for 501 HTTPS Required Error in Maven Build for Moving (http://repo1.maven.org/maven2 & http://repo.spring.io) to HTTPS?

Need Efficient Solution for moving to HTTPS for mvn clean install build success

Tried following solutions at my end

Still faced some issues for internal jars dependencies in the project.

Failed to read artifact descriptor for com.netflix.hystrix:hystrix-core:jar:1.5.13: Could not transfer artifact com.netflix.hystrix:hystrix-core:pom:1.5.13 from/to cxf-repo (http://repo1.maven.org/maven2/): Transfer failed for http://repo1.maven.org/maven2/com/netflix/hystrix/hystrix-core/1.5.13/hystrix-core-1.5.13.pom 501 HTTPS Required

Have read this doc for maven central repo movement to HTTPS https://blog.sonatype.com/central-repository-moving-to-https but couldn't get any proper resolution for internal dependency issue.

Some dependencies in my case are still calling http url's of central and spring maven

Upvotes: 3

Views: 6042

Answers (2)

Shriram Prajapat
Shriram Prajapat

Reputation: 51

Either upgrade your Maven version or

Restrict the current Maven version to use HTTPS links by modifying your POM:

Include the following code in pom.xml of your project.

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

Upvotes: 3

Sekhar T
Sekhar T

Reputation: 31

taking a backup of .m2 folder and doing clean and install worked for me.

Upvotes: 0

Related Questions