How to start weblogic though build.gradle

now I am calling this batch file in my gradle build file and since I want to execute my test after my server is started, I am running this in a thread

task startWeblogic(type:Exec) {
        println "--------------Start Weblogic------------------"
        commandLine = ['cmd', '/C', 'start', 'startweblogic.bat']
        println "-------------- Weblogic server started ------------------"
    }
    task startWeblogicThread()<<{
        def weblogicThread1 = Thread.start {
            startWeblogic.execute()
        }
          sleep 120000
        println "wake up and work"
    }
  startWeblogicThread.dependsOn copyEar
    test.dependsOn startWeblogicThread

When I run this, I am getting the below error, though process go ahead and after 2min it tries to execute my test but my server is not started due to this error :frowning:

Exception in thread “Thread-1” java.lang.IllegalStateException: Cannot start long running operation, as the task artifact state cache (D:.gradle\1.5\taskArtifacts) has not been locked.

at org.gradle.cache.internal.DefaultCacheAccess.checkThreadIsOwner(DefaultCacheAccess.java:192)

at org.gradle.cache.internal.DefaultCacheAccess.longRunningOperation(DefaultCacheAccess.java:175)