0

I have created spring batch application using Spring Boot. As soon as I open it using Eclipse, I get the below error in pom.xml.

Project build error: Non-resolvable parent POM for org.bcbsri.batch:DS-Script:0.0.1-SNAPSHOT: 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 and 'parent.relativePath' points at no local POM

I downloaded the certificate from https://repo.maven.apache.org/maven2 and tried to import in newly created jks file. I am not sure how to supply the path of this jks file. I do not have admin rights. Thus I am unable to import this certificate in the Java cacert.

BSMP
  • 4,596
  • 8
  • 33
  • 44
Neeraj Mittal
  • 1
  • 1
  • 1
  • 1

1 Answers1

0

I would say your question is duplicate of Problems using Maven and SSL behind proxy

You need to import the maven cert to the JDK that you are using. Let's say you download the maven cert as C:\mavenrepocert.cer and using jdk1.8.0_151, you can import the cert as follows from command line: keytool -import -file C:\mavenrepocert.cer -keystore "C:\Program Files\Java\jdk1.8.0_151\jre\lib\security\cacerts" -alias mavencert

Umesh Rajbhandari
  • 1,222
  • 9
  • 9
  • Thanks Umesh..I don't have admin rights. So I can not update the cacert located inside java. Can I have my maven project point to the certificate located at some other place instead of the default java location? – Neeraj Mittal Feb 02 '18 at 10:35
  • https://maven.apache.org/guides/mini/guide-repository-ssl.html mentions about using MVN_OPTS evn variable. Try setting Djavax.net.ssl.trustStore and Djavax.net.ssl.trustStorePassword to see if you can using another location of the cert file. – Umesh Rajbhandari Feb 05 '18 at 00:46