导读
在IDEA中使用Maven做项目构建工具是非常常见的,但在使用Maven中也会有许多的问题,今天在做做JDBC时遇到了引入依赖不成功的问题,反反复复的进行了仔细的分析也查看了网上的许多的帖子,做了各种各样的尝试,最终将问题解决,做出如下记录,希望遇到同样问题的你们可以不用那么的头疼。
问题
Idea在引入mysql-connector-java依赖包时出问题,pom文件报错,无法使用该依赖包:
导包dependency
<dependency>
<groupId>mysql
</groupId
>
<artifactId>mysql
-connector
-java
</artifactId
>
<version>5.1.25</version
>
</dependency
>
本地仓库进入对应的mysql包会有一个以.lastupdated结尾的文件,内容如下:
#NOTE
: This is a Maven Resolver internal implementation file
, its format can be changed without prior notice
.
#Fri Jul
03 17:23:50 CST
2020
http\
://maven
.aliyun
.com
/nexus
/content
/groups
/public/.error
=Could not transfer artifact mysql\
:mysql
-connector
-java\
:pom\
:5.1.25 from
/to alimaven
(http\
://maven
.aliyun
.com
/nexus
/content
/groups
/public/)\
: sun
.security
.validator
.ValidatorException\
: PKIX path building failed\
: sun
.security
.provider
.certpath
.SunCertPathBuilderException\
: ******unable to find valid certification path to requested target
*** ***
@
default-alimaven
-http\
://maven
.aliyun
.com
/nexus
/content
/groups
/public/.lastUpdated
=1593768230632
解决方法
按照网上的各种重新配置Maven ,重新依赖该包,删除报错文件等操作都不行,最终通过配置该参数得以解决,提供给有问题的大家: