# Dependencies syntax

**URL:** <https://discuss.gradle.org/t/dependencies-syntax/20030>\
**Category:** Help/Discuss\
**Created:** [October 17, 2016, 7:47am UTC](https://discuss.gradle.org/t/dependencies-syntax/20030 "2016-10-17T07:47:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bit2Gosu](https://avatars.discourse-cdn.com/v4/letter/b/dc4da7/32.png) [@Bit2Gosu](https://discuss.gradle.org/u/Bit2Gosu)\
**Post date:** [October 17, 2016, 7:47am UTC](https://discuss.gradle.org/t/dependencies-syntax/20030/1 "2016-10-17T07:47:18Z")

</div>

Hi!

Using the method “void dependencies(Closure configureClosure)” I can configure the dependencies of my projects.  
Example:  
dependencies {  
compile ‘org.codehaus.groovy:groovy-all:2.3.11’  
}

In this case the “dependencies” function is passed a configuration closure whose delegate is an object of type “DependenciesHandler”.  
What is don’t understand is how the line "compile ‘org.codehaus…’ can work. The DependencyHandler interface does not have a property called “compile”. Rather it seems that the function “Dependency add(String configurationName, Object dependencyNotation)” is called with “compile” and “org.codehaus…” as its two arguments.  
However the function name “add” does not have to be written. Why?

---

<div class="post-metadata">

**Author:** ![Lance\_Java](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/lance_java/32/787_2.png) [@Lance\_Java](https://discuss.gradle.org/u/Lance_Java)\
**Post date:** [October 17, 2016, 9:01am UTC](https://discuss.gradle.org/t/dependencies-syntax/20030/2 "2016-10-17T09:01:56Z")

</div>

It’s all down to groovy’s [methodMissing()](http://mrhaki.blogspot.co.uk/2009/11/groovy-goodness-create-dynamic-methods.html?m=1) support.

See [DefaultDependencyHandler.java#L112](https://github.com/gradle/gradle/blob/master/subprojects/core/src/main/java/org/gradle/api/internal/artifacts/dsl/dependencies/DefaultDependencyHandler.java#L112)
