As said in the Gradle
Gradle's build scripts give you the full power of Groovy.
I come across the following command:
apply plugin: 'java'
I tried to googling to encquire what it means at the Groovy point of view, but I have no idea. Is there a Groovy equivalent at all?
解决方案
What you see is a syntactic sugar provided by Groovy for a method call. [No braces in method calls & implicit map coercion]
apply plugin: 'java' is same as apply([plugin: 'java'])
apply() is available in Gradle's Project API and project instance is available in Gradle build script by default. (In Groovy terms, operations in build.gradle is delegated to project)