I am struggling to understand the gradle groovy syntax for dependencies and what is going on behind the scenes. As a starter I don't see what is exactly happening in this code snippet ....
dependencies {
compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
}
What I (hope to) understand (please correct if I am wrong):
dependecies
is a method of theorg.gradle.api.Project
interface /org.gradle.api.internal.project.DefaultProject
class which expects a Closure to configure the dependencies of the project.compile
is aorg.gradle.api.artifacts.Configuration
which has been added by theorg.gradle.api.plugins.JavaPlugin
What I don't understand:
What exactly is happening by specifying
group: 'commons-collections', name: 'commons-collections', version: '3.2'
?Does this invoke some magic method of the compile configuration object (if so, which one)?
Are
group
,name
andversion
named parameters of a method call or are they method calls themselves?Does this create a new
org.gradle.api.artifacts.Dependency
instance which is added to the compile configuration?