Gradle build fails with oracle-jdk-1.7.0_80/lib/security/cacerts (No such file or directory)

When I run gradle builds on teamcity, the build fails sometimes with the following error:

[14:35:38]##teamcity[buildProblem identity='2115137281' description='java.io.FileNotFoundException: /opt/oracle-jdk-1.7.0_80/lib/security/cacerts (No such file or directory)' type='gradleBuildProblem']

Related to https://issues.gradle.org/browse/GRADLE-3029

Thanks, could you please provide the full stack trace here?

[18:38:56]BUILD FAILED
[18:38:56]
[18:38:56]Total time: 7 mins 42.91 secs
[18:38:56]##teamcity[buildProblem identity='2115137281' description='java.io.FileNotFoundException: /opt/oracle-jdk-1.7.0_80/lib/security/cacerts (No such file or directory)' type='gradleBuildProblem']
[18:38:59]Process exited with code 1
[18:38:59]Gradle failure report
[18:38:59]FAILURE: Build failed with an exception.
[18:38:59]
[18:38:59]* What went wrong:
[18:38:59]Could not resolve all dependencies for configuration ':xxxxxxxx'.
[18:38:59]> Could not download snakeyaml.jar (org.yaml:snakeyaml:1.6)
[18:38:59]   > Could not get resource 'https://artifactory.xxx.xxx.com/plugins-release/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar'.
[18:38:59]      > Failure initializing default system SSL context
[18:38:59]
[18:38:59]* Try:
[18:38:59]Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
[18:38:59]Step Gradle failed

Thanks for providing more information. We pushed a fix to master. Could you please try out a Gradle 2.11 nightly build and see if your issue is fixed?

Awesome! Thanks Ben. I will try it out.

I have not seen the issue re-occur in 2.11 version. Thanks!