how to set a timeout to abort a GradleRunner build?
<p>I have a fairly crude task that runs tasks on gradle projects:</p>

<pre><code>def testProject(proj) {

        // test project task runs without error
        try {
                GradleRunner.create()
                        .withProjectDir(file("./examples/${proj}/"))
                        .withArguments('Example')
                        .forwardOutput()
                        .build()
        } catch (Exception e) {
            println "Test failed  ./examples/${proj}"
            return
        }

        println "Test passed  ./examples/${proj}"
}

task baseTest &lt;&lt; {
    println "Running base tests"

    [
      'WebHdfsLs',
      'WebHdfsMkdir',
      // other tests omitted for brevity

    ].each() { proj -&gt; buildProject(proj) }
}
</code></pre>

<p>However, if some of the projects fail they will hang indefinitely waiting for a response from the server.  </p>

<p>How can I introduce a timeout with GradleRunner to abort the build?</p>