0

I'm trying to build Spring music app using Gradle. This is the command I'm trying to use:

./gradlew clean build

It fails as follows:

FAILURE: Build failed with an exception.

I had a look on this topic and did the following:

1- Created ~/.gradle/gradle.properties and put the following inside:

org.gradle.jvmargs=-Djavax.net.ssl.keyStore="/Users/myusername/my_private_company_ca_bundle" -Djavax.net.ssl.keyStoreType=KeychainStore -Djavax.net.ssl.keyStorePassword=changeit

2- Also I added my CA bundle (Root CA and intermediate CA in one file)

sudo keytool -import -trustcacerts -alias root -file ./certificates/my_private_company_ca_bundle -keystore $JAVA_HOME/jre/lib/security/cacerts

Also, I made sure I'm putting my proxy settings in ~/.gradle/gradle.properties:

systemProp.http.proxyHost=<corporate_proxy>
systemProp.http.proxyPort=8080
systemProp.https.proxyHost=<corporate_proxy>
systemProp.https.proxyPort=8080

Here is my Java version:

java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)

What could be missing in my settings?

Joseph Wahba
  • 660
  • 3
  • 9
  • 25
  • (as you know,) the "PKIX error" is due to missing certificates in you java cacerts file. You already tried importing them- but either you imported the wrong certificates; or the Jvm in use to run Gradle is not the same where you imported the certs... – Daniele Jul 03 '19 at 21:01
  • you can double-check what jvm you are using; add to you gradle build file: `println(org.gradle.internal.jvm.Jvm.current()); println(String.class.getResource('/java/lang/Object.class'));` – Daniele Jul 03 '19 at 21:08

0 Answers0