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.
- What went wrong: Could not resolve all dependencies for configuration ':detachedConfiguration1'.
Could not resolve org.springframework.boot:spring-boot-dependencies:2.0.1.RELEASE.
Required by: project : Could not resolve org.springframework.boot:spring-boot-dependencies:2.0.1.RELEASE. Could not get resource 'https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-dependencies/2.0.1.RELEASE/spring-boot-dependencies-2.0.1.RELEASE.pom'. Could not HEAD 'https://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-dependencies/2.0.1.RELEASE/spring-boot-dependencies-2.0.1.RELEASE.pom'. sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
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?