Could not find property 'myTask' on task ':jar'

Hi,

I try to add the output result of a task to the jar-fragment. The task derives from “JoinWsdlTask”, a custom task class which builds a single-file wsdl out of a bunch of wsdl/xsd fragments. Unfortunately I am not able to refer to the task from within the project. The task is listed on “groovy tasks” and can be executed without any problems.

I stripped down my example to a short gradle build which shows the same behaviour.

apply plugin: ‘java’

sourceCompatibility = 1.6

jar {

dependsOn myTask

//from myTask.outputFile

}

task myTask {

group “build”

description “Führt die WSDL Fragmente des Produktservices zusammen”

}

Please help!

jar {
   dependsOn 'myTask'
  //from myTask.outputFile
 }

You forgot the quotes. The task “myTask” is defined after the dependsOn so you need to use quotes to tell gradle that the task “myTask” is not defined yet.