Gradle error Could not determine the dependencies of task ':compileJava'

  1. Below is my setup for gradle/jenkins
    centos 7,
    installed jenkins
    installed gradle in folder /opt/gradle/gradle-3.4.1
    added path using below
    export PATH=$PATH:/opt/gradle/gradle-3.4.1/bin

Under Manage Jenkins/Global Tools config, added gradle installation
Name - gradle3, Gradle Home - /opt/gradle/gradle-3.4.1
ran command ‘gradle init’ from the terminal

  1. Created pipeline ‘pipe4’ with config below
    pipeline {
    agent any
    stages{
    stage(‘source’) {
    steps {
    git ‘GitHub - javahometech/my-app
    }
    }
    stage(‘compile’) {
    tools {
    gradle ‘gradle3’
    }
    steps {
    sh ‘gradle compileJava’
    }
    }
    }
    }

  2. When I ran the build, fails with below message

  • What went wrong:
    Could not determine the dependencies of task ‘:compileJava’.

Could not create service of type CachingFileHasher using TaskExecutionServices.createFileSnapshotter().