个人电脑无法访问maven中心



我有一台PC,安装了游戏应用程序,如SteamGOG,但在Windows配置中,除了操作系统的默认防火墙外,没有代理和防火墙。我有NordVPN,但目前断开连接。但是在安装了maven 3.8.2之后,所有mvn目标都失败了,无法访问maven中心

PS C:DevCodeintellijmy-test> mvn archetype:generate -DgroupId="com.my.app" -DartifactId="mydemo" -DarchetypeArtifactId="maven-archetype-quickstart" -DinteractiveMode="false"

抛出下列错误

[WARNING] org.apache.maven.plugins/maven-metadata.xml failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.apache.maven.plugins/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-metadata.xml
[WARNING] org.codehaus.mojo/maven-metadata.xml failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer metadata org.codehaus.mojo/maven-metadata.xml from/to central (https://repo.maven.apache.org/maven2): transfer failed for https://repo.maven.apache.org/maven2/org/codehaus/mojo/maven-metadata.xml
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]     ------------------------------------------------------------------------
[INFO] Total time:  1.404 s
[INFO] Finished at: 2021-09-24T17:29:01-04:00
[INFO] ------------------------------------------------------------------------
[ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:Usersme.m2repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]

谁有解决这类问题的经验?没有来自settings.xml的额外配置,所有内容都是从maven站点

下载的maven zip文件目录中原始的。PS:这与命令行或Intellij或Eclipse的行为相同。这不是IDE的问题,而是环境/操作系统阻塞专家的问题,只是希望能有一些方法来调试这个问题

出现这个问题的原因是我在证书Maven过期的本地环境中运行OpenJDK8,升级到最新的OpenJDK解决了这个问题。@ProgrammersBlock使用-X的建议对于识别问题也非常有帮助

最新更新