【发布时间】:2018-11-07 21:39:04
【问题描述】:
在 GitLab CI 上使用 并行 Gradle 作业:
我收到以下 随机 Gradle 异常:
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().
我使用 gitlab-runner 的 docker 执行程序,没有任何 GitLab CI 缓存。我使用 Docker 卷而不是 Gradle 缓存指向该卷:
before_script:
- export GRADLE_USER_HOME=/pipelines/.gradle
/pipelines 目录的访问权限没有问题(所以它不是 this question 的重复)。
这个问题的简单但烦人的解决方法是手动重新触发失败的作业 - 然后它会顺利通过。另一种解决方法是通过retry 指令自动重新触发作业。
所以,我的问题是:是什么导致了作业失败以及如何解决它(无需重新触发作业)?
【问题讨论】:
标签: docker gradle gitlab-ci gitlab-ci-runner