Please add following syntax in custom plugin

I hope one subTask inherit superTask and invoke meth in superTask
// build.gradle

apply plugin: GreetingPlugin

class GreetingTask extends DefaultTask {
    def hello() {
        println "Hello from the GreetingPlugin"
    }
}

class GreetingPlugin implements Plugin<Project> {
    void apply(Project project) {
        project.task('hello', type: GreetingTask) << {
            hello()
        }
    }
}

Can you please elaborate on the problem here.