How to set up a Jenkins Parallel Pipeline build with Gradle?

Hello everyone!

My team uses a git monorepo that contains a multi-project gradle build (with Gradle 6.8 using KTS). What we would like to achieve is to build several sub-projects in parallel on Jenkins using Jenkins Pipelines (of course, we set this up such that only sub-projects that do not depend on one another are built in parallel). As a result, multiple gradlew commands are running simultaneously on the same project root directory. Unfortunately, this approach results in the following error:

org.gradle.cache.LockTimeoutException: Timeout waiting to lock buildSrc build lock. It is currently in use by another Gradle instance.
Owner PID: 4169
Our PID: 4192
Owner Operation: 
Our operation: 
Lock file: /home/ubuntu/workspace/build/buildSrc/.gradle/noVersion/buildSrc.lock

Do you have any advice on how to properly utilize Jenkins parallel pipelines with Gradle? The latest information on this topic I could find is from 2016…