Maven远程镜像无法使用解决方案(HTTPS协议Maven仓库无法使用解决方案)

在2020年01月15日maven的两大远程库都停止了对http协议的支持,改成了https,使用https就涉及到了认证问题。

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

在这里插入图片描述要解决这个问题可以暂时使用一下仓库地址,这个也是官方给出的解决方案:

	<!-- 中央仓库1 -->
	<mirror>
		<id>repo1</id>
		<mirrorOf>central</mirrorOf>
		<name>Human Readable Name for this Mirror.</name>
		<url>http://insecure.repo1.maven.org/maven2/</url>
	</mirror>

当然如果能够使用Maven国内镜像就更好比如阿里云的镜像,既支持http协议又支持https协议。

<mirror>
    <id>aliyunmaven</id>
    <mirrorOf>central</mirrorOf>
    <name>central</name>
    <url>https://maven.aliyun.com/repository/central</url>
</mirror>
发布了56 篇原创文章 · 获赞 17 · 访问量 6163

猜你喜欢

转载自blog.csdn.net/qq_43199016/article/details/104032747