execCommand == null(它实际上是'null not')

Avi*_*Avi 5 linux shell gradle

我在 build.gradle 中创建了 2 个任务。当我运行任务“remoteCopy”时,它运行良好。当我运行依赖于“remoteCopy”的任务时,出现以下错误:

Executing task ':importDump' (up-to-date check took 0.0 secs) due to:
  Task has not declared any outputs.
:importDump FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':importDump'.
> execCommand == null!
Run Code Online (Sandbox Code Playgroud)

任何指向我做错了什么的指针。build.gradle 如下所示:

**

 - build.gradle

**

task remoteCopy(type: Exec) {
        workingDir '/workspace/anivash.mutham/R10_CommercePlatform_DEV/buildtools/scripts'
        commandLine './remotecopy.sh'
}


task importDump(dependsOn: remoteCopy,type:Exec) << {
        workingDir '/workspace/anivash.mutham/R10_CommercePlatform_DEV/buildtools/scripts'
        commandLine './importdump.sh'
}
Run Code Online (Sandbox Code Playgroud)

Ste*_*aus 1

“importDump”任务声明无效,您必须移出workingDir/commandLine块,因为它们是Exec任务的属性。<< { }doLast { }

试试这个: task importDump(dependsOn: remoteCopy, type: Exec) { workingDir '/workspace/anivash.mutham/R10_CommercePlatform_DEV/buildtools/scripts' commandLine './importdump.sh' }