在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>