title: Understanding Gradle's mavenDeployer
body: <p>I'm a newbie in Gradle and Groovy in general, and I'm trying to understand the following example from the <a href="http://gradle.org/docs/current/userguide/userguide_single.html#sec:deploying_to_a_maven_repository" rel="noreferrer">Gradle user guide</a>, and especially how I could find, in the DSL documentation, where all these options can be found:</p>
  
  <pre><code>uploadArchives {
      repositories.mavenDeployer {
          name = 'sshDeployer' // optional
          configuration = configurations.deployerJars
          repository(url: "scp://repos.mycompany.com/releases") {
              authentication(userName: "me", password: "myPassword")
          }
      }
  }
  </code></pre>
  
  <p>What I understand:</p>
  
  <ul>
  <li><code>uploadArchives</code> is a task of type <code>Upload</code>, added to the project by the Java plugin</li>
  <li><code>repositories</code> is a property of the <code>Upload</code> task, of type <code>RepositoryHandler</code></li>
  </ul>
  
  <p>What I don't understand:</p>
  
  <ul>
  <li><code>mavenDeployer</code> doesn't appear anywhere in the <a href="http://gradle.org/docs/1.2/javadoc/org/gradle/api/artifacts/dsl/RepositoryHandler.html" rel="noreferrer">documentation of RepositoryHandler</a>. Where does it come from? How are we supposed to know that such a method exists?</li>
  <li>Searching in the index, I find that <code>mavenDeployer</code> is a method from <a href="http://gradle.org/docs/1.2/javadoc/org/gradle/api/plugins/MavenRepositoryHandlerConvention.html#mavenDeployer%28groovy.lang.Closure%29" rel="noreferrer">MavenRepositoryHandlerConvention</a> which is mixed in the RepositoryHandler associated with each task of type Upload. Too bad this isn't mentioned in <code>RepositoryHandler</code>'s documentation and Upload's documentation.</li>
  <li><p>Although it could be clearer, I understand that the closure must configure an object of type <code>GroovyMavenDeployer</code>. But reading the javadoc, the <code>repository</code> property for example is of type <code>Object</code>. How can I know that I can configure it using the following?</p>
  
  <pre><code>repository(url: "scp://repos.mycompany.com/releases") {
      authentication(userName: "me", password: "myPassword")
  }
  </code></pre></li>
  </ul>