【问题标题】:maven project Could not resolve archetypemaven 项目无法解析原型
【发布时间】:2023-03-23 03:13:01
【问题描述】:

我正在尝试在我的 Eclipse IDE 上启动一个 maven 项目,但我收到了此错误消息。我尝试添加远程代表http://repo.maven.apache.org/maven2/archetype-catalog.xml 目录文件。但它没有修复错误。 请让

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 t 
he 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): 
sun.security.validator.ValidatorException: 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

【问题讨论】:

标签: java eclipse maven


【解决方案1】:

我不确定这是否会有所帮助。 使用以下命令进行强制更新:

mvn clean install -U

-U -> Maven 强制更新。

【讨论】:

    【解决方案2】:

    您在公司网络中,对吗?然后代理或防火墙会阻止您的访问。为 Maven 配置正确的代理或与您的管理员联系。

    【讨论】:

      【解决方案3】:

      PKIX 路径构建失败: sun.security.provider.certpath.SunCertPathBuilderException:无法找到 请求目标的有效认证路径

      指出 SSL 存在问题。您使用的 java 没有有效的 CA 证书来验证来自 https://repo.maven.apache.org 的 SSL 证书,或者您的公司防火墙使用自己的证书劫持每个 https 流量 - 然后它本身必须在您的 java 信任库中可用。

      正如JF Meier 所说,在这种情况下,您应该联系您当地的管理员

      【讨论】:

        【解决方案4】:

        我遇到了“无法解析原型...以进行快速入门”的问题
        我看到一些原型可供选择,带有发行编号,而一些原型只有大写的“RELEASES”。
        我用浏览器按照写好的路径发现:
        需要 501 HTTPS。
        使用https://repo1.maven.org/maven2/
        更多信息https://links.sonatype.com/central/501-https-required
        因此他们将其更改为 https,您必须编辑路径以将外部原型访问到提到的: https://repo1.maven.org/maven2/
        这对我有用。
        可能您还必须寻找
        “设置.xml” 在“用户\您的用户名\.m2”中。

        【讨论】:

        • 点评来源: 嗨,虽然链接是分享知识的好方法,但如果它们在未来被破坏,它们将不会真正回答问题。将回答问题的链接的基本内容添加到您的答案中。如果内容太复杂或太大而无法在此处放置,请描述所提出解决方案的总体思路。请记住始终保留指向原始解决方案网站的链接引用。见:How do I write a good answer?
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2013-09-23
        • 1970-01-01
        • 1970-01-01
        • 2013-09-02
        • 2017-03-03
        • 2013-03-08
        • 2023-03-17
        相关资源
        最近更新 更多