title: Use Plugin Java API from Gradle build script
body: <p>I am trying to install a jar in my maven repository with the plugin:</p>
  
  <pre><code>apply plugin: 'maven'
  </code></pre>
  
  <p>Following the doc I am trying it this way:</p>
  
  <pre><code>def installer = install.repositories.mavenInstaller
  
  [installer]*.pom*.whenConfigured {pom -&gt;
      println pom
      org.apache.maven.model.Exclusion exclusion = new org.apache.maven.model.Exclusion()
      exclusion.setArtifactId("*")
      exclusion.setGroupId("*")
      pom.dependencies.each { dep -&gt; dep.addExclusion(exclusion) }
  }
  </code></pre>
  
  <p>But it fails with:</p>
  
  <pre><code>unable to resolve class org.apache.maven.model.Exclusion
  </code></pre>
  
  <p>More generally, how do I know how go from the plugin's API to the Gradle DSL?</p>