groovyConsole 定义task任务 报错

初学groovy,在groovyConsole运行

task helloworld {  
        println "helloworld!!"  
}

报错:Exception thrown

groovy.lang.MissingMethodException: No signature of method: ConsoleScript0.helloworld() is applicable for argument types: (ConsoleScript0$_run_closure1) values: [ConsoleScript0$_run_closure1@4bcc2b49],
是因为没有装相应的包吗?怎么下载?