首页 > 解决方案 > 无法在 Eclipse IDE 中使用 maven

问题描述

在选择 File->new->other->Maven Project-> maven-archetype-quickstart version 1.1 之后,我试图在我的 Eclipse IDE 中创建 Maven 项目,但我收到了这个错误

无法从任何已配置的存储库解析原型 org.apache.maven.archtypes:maven-archtype-quickstart1:1。

我尝试了很多方法,但错误仍然存​​在。我还卸载了eclipse并安装了几次,这个错误仍然存​​在。有人可以在这种情况下帮助我。

以下是我的错误跟踪

Could not resolve archetype org.apache.maven.archetypes:maven-archetype-quickstart:1.1 from any of the configured repositories.
Could not resolve artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1
Failure to transfer org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1 from/to central (https://repo.maven.apache.org/maven2): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Failure to transfer org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.archetypes:maven-archetype-quickstart:pom:1.1 from/to central (https://repo.maven.apache.org/maven2): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

标签: mavenmaven-2maven-3maven-pluginmaven-archetype

解决方案


假设这不是代理问题,您可能想尝试几件事:

  • 添加https://repo1.maven.org/maven2/archetype-catalog.xml作为远程目录。当您处于New Maven Project 窗口中的原型步骤时,选择Configure... -> Add Remote Catalog...,粘贴 URL,并为其命名。
  • 删除您的本地 Maven 存储库,默认情况下,该存储库位于.m2您的用户主目录的目录中。

如果您使用的是代理,您可以在首选项(常规->网络连接)中配置它。


推荐阅读