文章目录
- 小结
- 问题及解决
- 找不到有效证书
- 找不到org.springframework.stereotype.Service
- 问题IntelliJ: Cannot resolve symbol 'springframework'
- 参考
小结
将IntelliJ工程拷贝到新的机器中,返回Maven编译返回找不到有效证书的问题,进行了解决。
问题及解决
找不到有效证书
将IntelliJ工程拷贝到新的机器中,返回Maven编译返回找不到有效证书的问题,具体报错如下:
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and 'parent.relativePath' points at wrong local POM
首先下载证书, 点这个锁,并点击’Connection is Secure’:
点这个证书:
点"Detail"并对相应的证书进行下载:
下载后通过以下指令对证书进行导入(以下显示先前已经导入过了):
C:\Users\John Xiong\.jdks\temurin-11.0.21\bin>keytool -import -alias Maven -keystore "C:\Users\John Xiong\.jdks\temurin-11.0.21\lib\security\cacerts" -file "C:\Users\John Xiong\Downloads\repo.maven.apache.org.crt" -storepass changeit
Warning: use -cacerts option to access cacerts keystore
Certificate already exists in keystore under alias <maven2>
Do you still want to add it? [no]: No
Certificate was not added to keystore
C:\Users\John Xiong\.jdks\temurin-11.0.21\bin>
至此,Maven编译返回找不到有效证书的问题已经解决。
++++++++++++++++++++++++++++++++分割线+++++++++++++++++++++++++++
以下是尝试过的办法,并没有解决问题:
在VM Options添加-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
,忽略证书,问题依旧。
在Server Certificate下添加证书也是不行。
找不到org.springframework.stereotype.Service
添加以下:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
问题IntelliJ: Cannot resolve symbol ‘springframework’
这个问题是Maven同步有问题,点以下更新按钮:
参考
CSDN: 使用IDEA配置SpringBoot项目报错Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:2
Maven repository: Spring Boot Starter Test » 2.7.8
https://repo.maven.apache.org/maven2/
stackoverflow: Proxy Setting Issue with Maven update
stackoverflow:Spring tool suite- SunCertPathBuilderException: unable to find valid certification path to requested target
stackoverflow:How do I find the library containing org.springframework.stereotype.Service?
stackoverflow: IntelliJ: Cannot resolve symbol ‘springframework’