I am running into ‘Timeout waiting to lock buildscript class cache for build file’ error very frequently. Here is my workflow which leads to this:
- My gradle project has many sub-projects. 2) In one sub-project (say, ‘ONE-PRJ’) I launch a task which never ends (say, like an embedded Jetty server) using the ‘JavaExec’ task 3) One of my other sub-projects (say, ‘TWO-PRJ’) depends on ‘ONE-PRJ’ 4) I fetch changes from my remote git repository; one my colleague have changed the build script for ‘ONE-PRJ’ 5) I try to build ‘TWO-PRJ’. This tries to build ‘ONE-PRJ’, and can’t get the an exclusive lock to the script cache (which seems to be keyed by canonical path of the build script)
I have a reproducible test case at https://github.com/binil/gradle-long-running-task-problem
How do I launch a java program with ‘JavaExec’ relinquishing all locks?