gpt4 book ai didi

Maven - 无法找到有效的认证路径

转载 作者:行者123 更新时间:2023-12-04 19:28:30 28 4
gpt4 key购买 nike

我是 maven 新手,在添加依赖项 (sl4j) 时遇到问题。我得到了这个项目,它显然是从 ant 转换为 maven 的。顺便说一句,全新安装不起作用。这是 pom.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxx.tools</groupId>
<artifactId>someName</artifactId>
<version>1.0</version>
<name>A Name</name>
<description>Description</description>

<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.MyClient</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

它在全新安装时提供以下消息:
`ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade (default) on project xxxx: Execution default of goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade failed: Plugin org.apache.maven.plugins:maven-shade-plugin:3.1.0 or one of its dependencies could not be resolved: Failed to collect dependencies at org.apache.maven.plugins:maven-shade-plugin:jar:3.1.0 -> org.apache.maven:maven-plugin-api:jar:3.0 -> org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2 -> org.codehaus.plexus:plexus-component-annotations:jar:1.6: Failed to read artifact descriptor for org.codehaus.plexus:plexus-component-`annotations:jar:1.6: Could not transfer artifact org.codehaus.plexus:plexus-component-annotations:pom:1.6 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

最佳答案

您的 Maven 正在尝试从 下载间接依赖项Maven 中央存储库 位于 https://repo.maven.apache.org/maven2 ,这是一个安全的 HTTP 服务器 (HTTPS)。也许有一些 证书问题您的 Java 安装或网络基础设施上的某些安全规则阻止访问。

首先尝试在浏览器上访问该 URL 并检查它是否可以运行。 如果可以访问网站,问题不在您的网络上。可能您需要以某种方式修复 Java 可信证书列表才能接受该服务器。看看这个问题/答案:"PKIX path building failed" and "unable to find valid certification path to requested target"

但如果你真的无法访问 带有 HTTPS 的 Maven Central Repo 来自
您的浏览器,也许是因为您是 在一些代理后面 阻止您下载服务器证书的规则。当然,它也不适用于 Maven。然后,看看这个另一个问题/答案:Problems using Maven and SSL behind proxy

关于Maven - 无法找到有效的认证路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48593183/

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