Maven Nexus 2020 大坑紧急扩散:The Central Repository is Moving to HTTPS

如果你在用 Maven 的 Nexus,用 2.x 的低版本,或者 3.x 的高版本,都有可能遇到突然无法通过 Nexus 代理下载依赖的问题。

问题症状
In Service - Remote Automatically Blocked and Unavailable
在这里插入图片描述

原因如下:
https://support.sonatype.com/hc/en-us/articles/360041287334

官方公告:The Central Repository is Moving to HTTPS

自2020年1月15日起,中央储存库不再支持通过普通 HTTP 进行的不安全通信,并要求所有对储存库的请求都通过 HTTPS 进行加密。

如果访问旧的 http://repo1.maven.org/maven2/,会返回下面的信息:

501 HTTPS Required. 
Use https://repo1.maven.org/maven2/
More information at https://links.sonatype.com/central/501-https-required

需要改成 https 才能使用。

但是低版本的 Nexus 不支持 https 的访问,因此总是会出现 SSL 相关的错误。

想要接着使用 http,还可以继续使用下面的地址:

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

配置改地址后,低版本的 Nexus 可以继续使用。

发布了299 篇原创文章 · 获赞 1651 · 访问量 595万+

猜你喜欢

转载自blog.csdn.net/isea533/article/details/104018644