【问题标题】:Unable to use maven in Eclipse IDE无法在 Eclipse IDE 中使用 maven
【发布时间】:2021-05-07 04:59:02
【问题描述】:

选择 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

【问题讨论】:

  • 可能是网络/防火墙问题。
  • 您使用哪个 JDK 版本? ` sun.security.provider.certpath.SunCertPathBuilderException: un? ?
  • JDK版本为JDK 1.8

标签: maven maven-2 maven-3 maven-plugin maven-archetype


【解决方案1】:

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

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

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

【讨论】:

  • 我试过你的步骤。但错误仍在继续。在我添加远程目录后,它没有在那里显示任何工件。我必须选择目录文件中的所有目录才能选择任何内容并最终单击下一步。我可以知道我应该在网络连接中做什么。此时它在 Active Provider 字段中显示 Native。
猜你喜欢
  • 2016-06-02
  • 2015-12-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-11-30
相关资源
最近更新 更多