Maven-无法找到有效的认证路径 [英] Maven - unable to find valid certification path

查看:33
本文介绍了Maven-无法找到有效的认证路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Maven的新手,在添加依赖项时遇到问题(Sl4j)。我得到了这个项目,这个项目显然是从蚂蚁变成了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

您的推荐答案正在尝试从位于https://repo.maven.apache.org/maven2https://repo.maven.apache.org/maven2Maven中央存储库下载间接依赖项,该服务器是受保护的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-无法找到有效的认证路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆