Reputation: 836
Need Efficient Solution for moving to HTTPS for mvn clean install
build success
Tried following solutions at my end
Added following settings.xml in ~/.m2/ folder. Tried Profiling options also.
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository>${user.home}/.m2/repository</localRepository>
<interactiveMode/>
<offline/>
<pluginGroups/>
<servers/>
<mirrors>
<mirror>
<id>central-repository</id>
<name>Maven Repository HTTPS</name>
<url>https://repo1.maven.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
<mirror>
<id>central-spring-repository</id>
<name>Spring Repository HTTPS</name>
<url>https://repo.spring.io</url>
<mirrorOf>springcentral</mirrorOf>
</mirror>
<mirror>
<id>organisation-repo1</id>
<name>org-repo1</name>
<url>http://org.maven.com/repo1</url>
<mirrorOf>repo1</mirrorOf>
</mirror>
<mirror>
<id>organisation-repo2</id>
<name>org-repo2</name>
<url>http://org.maven.com/repo2</url>
<mirrorOf>repo2</mirrorOf>
</mirror>
</mirrors>
<proxies/>
<profiles/>
<activeProfiles/>
</settings>
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
Added following in pom.xml
<repositories>
<repository>
<id>central-maven</id>
<name>central https Releases</name>
<url>https://repo.maven.apache.org/maven2</url>
</repository>
<repository>
<id>central-spring</id>
<name>central spring https Releases</name>
<url>https://repo.spring.io</url>
</repository>
<repositories>
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
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
Reputation: 31
taking a backup of .m2 folder and doing clean and install worked for me.
Upvotes: 0