Gradle Clean/Build takes long time while running from Jenkins slave but its faster when I run from local command line on the same slave with the same user logged in.
I have a gradle job configured and it runs as part of multi branch pipeline.
* Checkout - First stage
* Clean - Second stage
* Build - Thrid stage
When the job is run from Jenkins (dedicated slave), it took 12 mins of time to complete the clean operation and 1 hour for build operation.
Whereas, when I logged into the same slave machine with same user I used in Jenkins, it took only 4 mins for clean and 15 mins for build.
The remote root directory is in NFS path. I also played around increasing the heap space for Jenkins slave with advanced JVM options "-Xms4096M -Xmx8192M -XX:MaxPermSize=4192M -Djava.awt.headless=true", but it doenst help much.
Please share your thoughts.
Regads,
Saravanan