gpt4 book ai didi

java - Maven 构建失败,无法在 org.springframework :spring-core:jar:4. 0.2.RELEASE 收集依赖项

转载 作者:行者123 更新时间:2023-12-01 11:12:21 24 4
gpt4 key购买 nike

我搜索了又搜索,但没有解决这个问题。有人可以建议我如何解决这个问题吗?

在我的工作项目工作区中运行以下命令

mvn compile

产生以下错误。

[ERROR] Failed to execute goal on project acme: Could not resolve 

dependencies for
project com.acmecorp.acme:acme:war:GUI 5.0: Failed to collect dependencies at
org.springframework:spring-core:jar:4.0.2.RELEASE: Failed to read artifact descriptor
for org.springframework:spring-core:jar:4.0.2.RELEASE: Could not transfer
artifact org.springframework:spring-core:pom:4.0.2.RELEASE 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 -> [Help 1]

是的,我已经在 .m2 文件夹中的 settings.xml 文件中检查了我的代理。这是它的样子。

<proxies>
<proxy>
<active>true</active>
<protocol>https</protocol>
<username>USER</username>
<password>PASS</password>
<host>proxy.host.com</host>
<port>80</port>
</proxy>
<proxy>
<active>true</active>
<protocol>http</protocol>
<username>USER</username>
<password>PASS</password>
<host>proxy.host.com</host>
<port>80</port>
</proxy>
</proxies>

如有任何建议,我们将不胜感激。

操作系统Windows 7

最佳答案

您需要获取maven repo服务器的ssl证书并将其复制到本地jre/lib/security文件夹中。

步骤:1.下载这个Java程序https://confluence.atlassian.com/download/attachments/180292346/InstallCert.java

  • 编译
  • 使用命令行参数运行maven repo服务器
  • 将生成的 ssl 复制到本地 JRE/lib/security
  • 有关详细步骤,请关注此帖子:

    http://www.mkyong.com/webservices/jax-ws/suncertpathbuilderexception-unable-to-find-valid-certification-path-to-requested-target/

    关于java - Maven 构建失败,无法在 org.springframework :spring-core:jar:4. 0.2.RELEASE 收集依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32208662/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com