General question about the Syntax in a script

In a script using the Java plugin (apply plugin: ‘java’) I have found in some examples the following instruction :

jar {

manifest {

attributes ‘Implementation-Title’: ‘Gradle Quickstart’,

‘Implementation-Version’: version

} } My general question is : what represent jar ? A method ? An instance of a task ? … Where can I find the specification of jar ? In the DSL, the JavaDoc, GroovyDoc ?


The ‘jar’ task is added by the Java plugin (see the Java plugin chapter in the Gradle User Guide). The ‘Jar’ task type is documented in the Gradle Build Language Reference.

Technically, ‘jar { … }’ is a (dynamic) method call with a single (Groovy closure) argument, but usually we don’t think of it this way. Instead we think of it as configuring a model element (task in this case) named ‘jar’.