Java spring boot starter-thymeleaf - 无法找到请求目标的有效认证路径 [英] Java spring boot starter-thymeleaf - unable to find valid certification path to requested target

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

问题描述

我是 springboot 的初学者.我正在尝试使用 thymeleaf 和 html 在 localhost8080 上显示文本.尝试在 maven 中下载依赖项后:

<依赖><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId><version>1.5.10.RELEASE</version></依赖>

我收到这条消息:

<块引用>

无法读取 org.springframework.boot 的工件描述符:spring-boot-starter-thymeleaf:jar:1.5.10.RELEASE

在文件夹中:

<块引用>

C:\Users\myUser\.m2\repository\org\Spring Framework\boot\spring-boot-primer-thymeleaf\1.5.10.RELEASE"

有一个文件:

<块引用>

spring-boot-primer-thymeleaf-1.5.10.RELEASE.pom.lastUpdated

内容:

<块引用>

注意:这是一个 Aether 内部实现文件,其格式可以更改,恕不另行通知.#Sat Mar 03 08:48:15 CET 2018 @default-central-ttps://repo.maven.apache.org/maven2/.lastUpdated=1520063295482 https://repo.maven.apache.org/maven2/.error= 无法将工件 org.springframework.boot:spring-boot-starter-thymeleaf:pom:1.5.10.RELEASE 从/传输到中央 (https://repo.maven.apache.org/maven2):sun.security.validator.ValidatorException:PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:无法找到到请求目标的有效认证路径

其他依赖项如 spring-boot-starter-web 或 guava 正常工作.2.0.0.REALESE 和其他版本的问题是一样的.如有任何建议,我将不胜感激.

和我的 pom.xml

http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0<groupId>AKBootCamp8</groupId><artifactId>kwejk</artifactId><version>1.0-SNAPSHOT</version><父母><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.5.10.RELEASE</version><relativePath/><!-- 从存储库中查找父级 --></父母><依赖项><依赖><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><version>1.5.10.RELEASE</version></依赖><依赖><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId></依赖></依赖项>

解决方案

你的父母应该:

<groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-parent</artifactId><version>1.5.10.RELEASE</version><relativePath/><!-- 从存储库中查找父级 --></父母>

依赖应该是:

<依赖><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-thymeleaf</artifactId></依赖>

从依赖项中删除 1.5.10.RELEASE 并检查.

I am a beginner in springboot. I'm trying to use thymeleaf and html to display the text on localhost8080. After trying to download dependencies in maven:

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
        <version>1.5.10.RELEASE</version>
    </dependency>

I get this message:

Failed to read artifact descriptor for org.springframework.boot: spring-boot-starter-thymeleaf: jar: 1.5.10.RELEASE

in the folder:

"C: \ Users \ myUser \ .m2 \ repository \ org \ Spring Framework \ boot \ spring-boot-primer-thymeleaf \ 1.5.10.RELEASE"

there is a file:

spring-boot-primer-thymeleaf-1.5.10.RELEASE.pom.lastUpdated

with the content:

NOTE: This is an Aether internal implementation file, its format can be changed without prior notice. #Sat Mar 03 08:48:15 CET 2018 @default-central- ttps://repo.maven.apache.org/maven2/.lastUpdated=1520063295482 https://repo.maven.apache.org/maven2/.error=Could not transfer artifact org.springframework.boot:spring-boot-starter-thymeleaf:pom:1.5.10.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

other dependencies such as spring-boot-starter-web or guava work correctly. Problem is the same for 2.0.0.REALESE and others. I will be grateful for any advice.

and my pom.xml

<?xml version="1.0" encoding="UTF-8"?>

http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>AKBootCamp8</groupId>
<artifactId>kwejk</artifactId>
<version>1.0-SNAPSHOT</version>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.10.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <version>1.5.10.RELEASE</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
</dependencies>

解决方案

Your parent should be:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.10.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

And dependency should be:

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>

Remove <version>1.5.10.RELEASE</version> from dependency and check.

这篇关于Java spring boot starter-thymeleaf - 无法找到请求目标的有效认证路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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