0

My experience is almost exactly like the one who posted here Certification path error when creating Maven project in Eclipse except I haven't been able to fix my problem

I created a blank maven simple web project (in both eclipse and in vscode) but in my pom.xml at the parent tag, I get the following error.

Project build error: Non-resolvable parent POM for com.group:demo:0.0.1-SNAPSHOT: org.springframework.boot:spring-boot-starter-parent:pom:2.6.3 failed to transfer from https://nexus.company.com/repository/maven-central-proxy/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of e-maven-central-mirror has elapsed or updates are forced. Original error: Could not transfer artifact org.springframework.boot:spring-boot-starter-parent:pom:2.6.3 from/to e-maven-central-mirror (https://nexus.company.com/repository/maven-central-proxy/): PKIX 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

In my settings.xml, I have my proxies, servers and mirrors tags set with the necessary information. (By my company's setup guide, this is all I should have but even with the proxy tags added, the non-resolvable parent POM error message stays)

<settings>   
  <servers>
    <server>
      <id>e-maven-central-mirror</id>
      <username>username</username>
      <password>tokenpassword</password>
    </server>   
  </servers>   
  <mirrors>
    <mirror>
     <!-- Comments about what are happening here -->
     <id>e-maven-central-mirror</id>
     <mirrorOf>*</mirrorOf>
     <url>https://nexus.company.com/repository/maven-central-proxy/</url>   
    </mirror>   
  </mirrors> 
</settings>

I'm able to access the url with my id and my token password as normal. I've also gone through the trouble of adding the https://nexus.company.com/repository/maven-central-proxy certificate to both my %JAVA_HOME% (Jdk11) and %JRELOC% (Jre8) cacerts using the keytool. (I added to both as I wasn't sure which Java was the one being used)

I have spent a couple days on this and I'm not sure what it is that I'm doing wrong. Any clarification would be greatly appreciated. Thanks

Edit: I have my env variables HTTP_PROXY and HTTPS_PROXY set. Also saw that my nexus certificates were added to my JDK's keystore but not in the JRE's keystore if that's any useful informtation.

NotSure
  • 39
  • 7
  • The message `PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid` implies that the certs are not there where they expected...furthermore the question is which JDK you are using and which Maven version do you use? – khmarbaise Jan 28 '22 at 06:53
  • @khmarbaise I believe I was using the JDK 11 and embedded Maven for Eclipse. However, I'm primarily focusing on using VSCode so I used the Java Extension Pack and the Maven Extension as well. I do not have Maven installed on my machine so I cannot do any mvn commands if I wanted to. So I don't know what version of Maven I have. I also do not know how to check if VSCode looks for a JDK installed on my machine and if so, where is that setting. – NotSure Jan 28 '22 at 12:24
  • Install the most recent version of Maven on your machine https://maven.apache.org/download.cgi and https://maven.apache.org/install.html Also have a working JDK correctly installed ... – khmarbaise Jan 28 '22 at 12:34
  • Hi, I have installed Maven on my machine and my JDK seems correct. Here are my system env variables: JAVA_HOME = C:\Program Files\Amazon Corretto\jdk11.0.10_9 JRE64LOC = C:\Program Files\Java\jre8 JRELOC = C:\Program Files (x86)\Java\jre8 – NotSure Jan 28 '22 at 14:19

0 Answers0