maven发生501, ReasonPhrase:HTTPS Required错误

最近用maven打包的时候,发生了如下的错误:
501, ReasonPhrase:HTTPS Required

这是因为在访问maven central库的时候,已经不再支持http方式的连接,必须要用https了。

在 maven 的 settings.xml 中设定如下内容即可解决:

<mirror>
      <id>central</id>
      <mirrorOf>central</mirrorOf>
      <name>central</name>
      <url>https://repo.maven.apache.org/maven2/</url>
</mirror>

发表评论

邮箱地址不会被公开。 必填项已用*标注