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

时间:2016-10-14 15:05:14

标签: 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!

指出我做错了什么。 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'
}

1 个答案:

答案 0 :(得分:0)

&#34; importDump&#34;任务声明无效,您必须将workingDircommandLine移出<< { } / doLast { }块,因为它们是Exec任务的属性。

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

相关问题