javamavencertificatesourceforge

Maven build issue: PKIX path building failed


In our application which is being built using maven, part of the build process is to retrieve files in an archive to include them for runtime usage. This archive is hosted on sourceforge (here) and the retrieval worked flawlessly until a few weeks ago, when this message started showing up:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.8:run (process-resources-windows) on project ums-core: An Ant BuildException has occured: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
[ERROR] around Ant part ...<get usetimestamp="true" src="http://downloads.sourceforge.net/project/ums-mlx/ums-tools/win32/transcode-tools-win32-20160915.tar.gz" dest="E:\dev\ums-mlx\ums-mlx\core/src/main/external-resources/transcode-tools/transcode-tools-win32-20160915.tar.gz"/>... @ 5:255 in E:\dev\ums-mlx\ums-mlx\core\target\antrun\build-main.xml

Some online search brought me to this post explaining how to add a trusted certificate to the java keystore.

So I've checked what certificate is being used: used certficate

Exported the certificate (I thought was being used): exported certificate

And imported it with:

C:\Program Files\Java\jdk1.8.0_91\jre\bin>keytool -import -keystore ..\lib\security\cacerts -file c:\root.cer
Enter keystore password:
Certificate was added to keystore

A second import results in this message:

C:\Program Files\Java\jdk1.8.0_91\jre\bin>keytool -import -keystore ..\lib\security\cacerts -file c:\root.cer
Enter keystore password:
keytool error: java.lang.Exception: Certificate not imported, alias <mykey> already exists

When doing keytool -list -keystore ..\lib\security\cacerts, following entries related to GeoTrust show up:

Line 53: geotrustuniversalca, 10-Dec-2009, trustedCertEntry,
Line 67: geotrustprimaryca, 10-Dec-2009, trustedCertEntry,
Line 133: geotrustglobalca, 18-Jul-2003, trustedCertEntry,
Line 169: geotrustprimarycag3, 10-Dec-2009, trustedCertEntry,
Line 171: geotrustprimarycag2, 10-Dec-2009, trustedCertEntry,

Does anybody know what is missing in order to make the build process work again?

[edit] used maven version is:

E:\dev\ums-mlx\ums-mlx>mvn -v
Apache Maven 3.2.5 (12a6b3acb947671f09b81f49094c53f426d8cea1; 2014-12-14T18:29:23+01:00)
Maven home: C:\Program Files (x86)\apache-maven-3.2.5
Java version: 1.8.0_91, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_91\jre
Default locale: en_GB, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "dos"

Solution

  • It turned out that upgrading the java jdk to 8u121 solved the issue!?