对http://repo1.maven.org/maven2/的请求返回501 HTTPS必需的状态和主体
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了对http://repo1.maven.org/maven2/的请求返回501 HTTPS必需的状态和主体相关的知识,希望对你有一定的参考价值。
截至2020年1月15日,我在向中央存储库提出请求后收到以下答复:
向http://repo1.maven.org/maven2/的请求返回501 HTTPS必需状态和正文:
501需要HTTPS。使用https://repo1.maven.org/maven2/有关更多信息,请访问https://links.sonatype.com/central/501-https-required对http://repo.maven.apache.org/maven2/的请求返回501 HTTPS必需状态和正文:
501需要HTTPS。使用https://repo.maven.apache.org/maven2/有关更多信息,请访问https://links.sonatype.com/central/501-https-required如何满足此要求,以便我可以重新访问Central?
我在控制台中收到此错误
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------------< >----------------------------
[INFO] Building demo 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] Downloading from : http://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/3.12.0/mongo-java-driver-3.12.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.136 s
[INFO] Finished at: 2020-01-16T15:27:53+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project demo: Could not resolve dependencies for project com.tcs:demo:jar:0.0.1-SNAPSHOT: Failed to collect dependencies at org.mongodb:mongo-java-driver:jar:3.12.0: Failed to read artifact descriptor for org.mongodb:mongo-java-driver:jar:3.12.0: Could not transfer artifact org.mongodb:mongo-java-driver:pom:3.12.0 from/to central (http://repo1.maven.org/maven2/): Failed to transfer http://repo1.maven.org/maven2/org/mongodb/mongo-java-driver/3.12.0/mongo-java-driver-3.12.0.pom. Error code 501, HTTPS Required -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace ``of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
并且使用站点插件:
[[错误]]无法在my-proj项目上执行目标org.apache.maven.plugins:maven-site-plugin:2.2:site(默认站点):SiteToolException:无法从存储库中解析站点描述符:ArtifactResolutionException :无法找到站点描述符:无法将工件org.xy:name:xml:site_en:3.5.1.b550从中央传输到中央(http://repo1.maven.org/maven2):http://repo1.maven.org/maven2/org/x/y/3.5.1.b550/name-3.5.1.b550-site_en.xml 501 HTTPS必需的传输失败
从2020年1月15日起生效,中央存储库不再支持通过纯HTTP进行的不安全通信,并且要求通过HTTPS对存储库的所有请求进行加密。
请注意,您的父pom也可以(重新)定义存储库,并且如果它已覆盖中央存储库,则需要对其进行修复(因此需要解决的地方:〜/ .m2 / settings.xml以及父pom)。
以上是关于对http://repo1.maven.org/maven2/的请求返回501 HTTPS必需的状态和主体的主要内容,如果未能解决你的问题,请参考以下文章