Disclaimer: I haven’t taken much time to understand the codebase.
It seems there’s a race condition initializing the root project’s buildscript classpath. What’s the reason for wanting to create the detached configurations in the root project’s buildscript? Why not create them in the current project?
If you did
Configuration config = project.getConfigurations().detachedConfiguration(deps)
Instead of
Configuration config = project.getRootProject().getBuildscript().getConfigurations().detachedConfiguration(deps)
I’d assume any race conditions could be avoided since each thread would be mutating a separate project instance