# ArtifactHandler methodMissing

**URL:** <https://discuss.gradle.org/t/artifacthandler-methodmissing/32697>\
**Category:** Help/Discuss\
**Created:** [August 6, 2019, 1:28pm UTC](https://discuss.gradle.org/t/artifacthandler-methodmissing/32697 "2019-08-06T13:28:18Z")\
**Posts on this page:** 1\
**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:** [August 6, 2019, 1:28pm UTC](https://discuss.gradle.org/t/artifacthandler-methodmissing/32697/1 "2019-08-06T13:28:18Z")

</div>

Hi,

class “Project” has a method “void artifacts(Closure configureClosure)”. This method executes the given closure against a delegate of type “ArtifactHandler”.

It is possible for example to write:

artifacts  
{  
archives(file(‘someFile’)) { }  
}

“archives” is the name of a configuration added by the java plugin.

The above syntax suggests that there is a method “archives” in class “ArtifactHandler”. That is not the case. There are however multiple versions of a method “add” with suitable parameters. If the method “archives” cannot be found the method “methodMissing” should be called. However I have looked at the class DefaultArtifactHandler (its the only implementation i found). It does not overwrite “methodMissing”. So why can I write “archives(file(‘someFile’)) { }” in that closure?  
I now the documentation tells me I can do it, but I’m looking for the technical explanation.

Thanks in advance!
