Using parallel Gradle jobs on GitLab CI:
I'm receiving following random Gradle exception:
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type ResourceSnapshotterCacheService using GradleUserHomeScopeServices.createResourceSnapshotterCacheService().
I use a docker executor of gitlab-runner without any GitLab CI caching. I use a Docker volume instead with Gradle cache pointing to that volume:
before_script:
- export GRADLE_USER_HOME=/pipelines/.gradle
There is no issue with access rights to the /pipelines directory (so it's not duplicity of this question).
Simple, but annoying workaround to this issue is just to re-trigger the failed job manually - then it passes without any problem. Another workaround could to re-trigger the job automatically via the retry directive.
So, my question is: What is causing the job failure and how to solve it (without job re-triggering)?
