Cache Dependencies in Jenkins with NAS

I’m running a multi-job build process in Jenkins for Java project built with Gradle.
I’m using Gradle 4.2.

All of the Jenkins slaves are connected to a NAS. The user home directory is stored on that NAS so currently when we run several jobs at the same time we get an error that Gradle fails to lock a file in the cache directory.

I would like to take as much advantage of the cache as possible so I will like to know if it is possible to store the dependencies cache in a single directory in the NAS and have all slaves use that one directory.

Is that possible?

Hi, did you solve this in the meantime or does anybody else have a Tip? Simple moving the gradle Home is, as stated, not an optimal solution due to the locks.
Edit: Just found that Post Why is dependency cache located under project root on Jenkins?. Which Points Out that Sharing gradle Home should be The solution