当我使用Primefaces Maven存储库时,我得到以下异常
mvn clean spring-boot:run
[ERROR] Failed to execute goal on project Passwortmanager: Could not resolve dependencies for project org.dominik:Passwortmanager:jar:2.0.3: Failed to collect dependencies at org.primefaces.themes:all-themes:jar:1.0.10: Failed to read artifact descriptor for org.primefaces.themes:all-themes:jar:1.0.10: Could not transfer artifact org.primefaces.themes:all-themes:pom:1.0.10 from/to prime-repo (https://repository.primefaces.org): sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target -> [Help 1]
我的POM.xml
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.dominik</groupId>
<artifactId>Passwortmanager</artifactId>
<packaging>jar</packaging>
<version>2.0.3</version>
<repositories>
<repository>
<id>prime-repo</id>
<name>PrimeFaces Maven Repository</name>
<url>https://repository.primefaces.org</url>
<layout>default</layout>
</repository>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/libs-snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.primefaces.themes</groupId>
<artifactId>all-themes</artifactId>
<version>${primefaces.theme.version}</version>
</dependency>
</dependencies>
<finalName>Passwortmanager</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
官方Primefaces Showcase也不起作用:https://github.com/primefaces/showcase
答案 0 :(得分:4)
替代解决方案:
答案 1 :(得分:0)
为简单起见,通过安全通道(安全http / https)提供服务的网站/服务需要添加其认证,以便其客户可以信任它们。
存储库“ https://repository.primefaces.org”使用加密证书。有趣的是,通常您可以在浏览器中打开链接,但是Java抛出安全异常,这是因为Java将其证书存储在单独的位置(对我来说就是这样:Windows7,Oracle Java 1.8.0_92)。它将证书存储在{jre_PATH} / lib / security中。
但是,您应该注意其中有two jre directories,并且由于我们在构建时使用JDK,因此我们应该将新证书添加到jdk目录中的jre。
要添加新认证,请在浏览器(firefox)中打开“ https://repository.primefaces.org”并导出认证。 (我选择了带有链的X.509 certification),然后需要将其添加到密钥库中:
keytool -keystore cacerts -importcert -file [NAME_OF_CERT_FILE]
然后输入密码(默认密码为“ changeit”)
就是这样:)