IntelliJ Idea

Answered

I have not able to compile the RestControl because of Security Exception and error message is as follows.

Failure to transfer org.springframework.boot:spring-boot-starter-parent:pom:1.5.9.RELEASE from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.9.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.

I tried adding certificate to cacert file using key tool in my JRE lib but did not work. I have added it to the IntelliJ Idea tool when it asked to add untrusted certificates.  I tried in both latest version 2017.3.3 and 2017.3.2. My current JDK and JRE versions are 1.8.0_144

2
15 comments

Does it build from the command line Maven in the console/terminal?

Did you add the certificate into the JVM that is used to run Maven from IntelliJ IDEA? Note that this JVM can be changed in the IDE Maven settings.

0
Avatar
Permanently deleted user

Can you explain how to do the mentioned steps? I am running on windows 7 32bit?

0

Run 'mvn clean install' in the command line to see if it completes without errors.

Maven JDK can be changed here:

The certificate can be installed into this JDK as described here.

7
Avatar
Permanently deleted user

I checked maven settings and pointed JRE to JDK one. Still same problem. See the image attached. I have checked the internet settings and we do not have any proxy. I imported the certificate by going to https://www.google.com and saving the certificate as one of post mentioned. I am surprised "why I have to do that". Also I imported the certificates from https://plugins.jetbrains.com. Nothing worked. 

1

Run 'mvn clean install' in the command line to see if it completes without errors.

0
Avatar
Permanently deleted user

Got the same error from command line when running mvn clean install command

0
Avatar
Permanently deleted user

Here is the error.

C:\jprojects>mvn clean install
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-starter-parent/1.5.9.RELEASE/spring-boot-starter-parent-1.5.9.RELEASE.pom

[ERROR] [ERROR] Some problems were encountered while processing the POMs:[FATAL] Non-resolvable parent POM for com.jm:remarketing:0.0.1-SNAPSHOT: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:1.5.9.RELEASE from/to central (https://repo.maven.apache.org/maven2): sun.security.validator.ValidatorException: KIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target and 'parent.relativePath' points at no local POM @ line 14, column 10

1

So, the issue has no relation to IntelliJ IDEA. JVM used to run Maven seems to miss the certificates needed to access this repository or your proxy (if any). There is nothing we can do to address this problem on IntelliJ IDEA side.

1
Avatar
Permanently deleted user

Problem has been fixed now. I have installed on my local JRE folder. That did not work. You have to install in JDK path. Below are the instructions for anyone who may encounter the same issue.

Get the certificate from https://repo.maven.apache.org/maven2/ and save into your local directory. Certificate type can be default one. In my case DER encoded. You have to install certificate in jdk path. In my case the path is C:\Program Files\Java\jdk1.8.0_144\jre\lib\security. Here is the command to install certificate. In command prompt, go to directory C:\Program Files\Java\jdk1.8.0_144\jre\lib\security and do the following.

keytool -import -file C:\maven.cer -keystore cacerts -alias mavencert

C:\maven.cer is the certificate I saved from https://repo.maven.apache.org/maven2/

 

 

Thanks,

Narsi

1

Hi, Serge, 

I am having the same problem with @Npulukuri. I have read the post you provide here. Apart from the 64|32 bit stuff I don't see my system, I believe I execute other steps correctly. 

I guess this is an Intellij issue. 

Let me share more details with this issue:

  1. Using mvn clean install, it will download the dependency and save to my local repo, but intellij cannot automatically resolve this.
  2. I am pretty sure I installed the certificate to the JDK/JRE (I installed both. I made the same mistake like @Npulukuri since I read from a post from StackOverflow)
  3. I also installed the certificate to intellij's cacert ( on Windows,  C:\Users\<username>\.IdeaIC2018.1\system\tasks, the same thing also happens to the Mac)
  4. I choose the jdk to my jdk, not the one intellij provided. 
  5. I tried to reimport pom.xml, still cannot automatically resolve the dependency
  6. Intellij itself cannot update the repo.
  7. The log shows this, which is a certificate error. 
  8. Are you sure that intellij side cannot reproduce it?
  9. Intelllij Version:
  10. IntelliJ IDEA 2018.1 (Community Edition)
    Build #IC-181.4203.550, built on March 26, 2018
    JRE: 1.8.0_152-release-1136-b20 amd64
    JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
    Windows 10 10.0

 

Thanks,

Jackal

 

1

IntelliJ IDEA JRE is in IDEA_HOME\jre64 directory, not `C:\Users\<username>\.IdeaIC2018.1\system\tasks`.

2

Nice ... Kind of wonder why it's related to JRE. This is the fasted Community Support I got. (btw, what's wrong with new version of GitBook :( )

0
Avatar
Permanently deleted user

thanks @Npulukuri and @serge - your instructions were helpful in resolving the same issue I was facing

0

help plz! um trying to create a new Maven project from 2020.3.2 and it throwing an 'Error Loading Default Project'

java.nio.file.NotDirectoryException: C:\Users\userProject\IdeaProjects\mav1\.idea\libraries

0

Please sign in to leave a comment.