title: Gradle error: Could not find method jar() for arguments
body: <p>I'm writing a custom plugin which adds some data to manifest of Java project.</p>
  
  <p>It looks something like this:</p>
  
  <pre><code>package com.example.gradle
  
  import org.gradle.api.Plugin
  import org.gradle.api.Project
  
  public class ExamplePlugin implements Plugin&lt;Project&gt; {
  
      def apply(Project project) {
          project.jar() {
              manifest {
                  attributes 'buildServer': checkIfIsBuildServer()
                  attributes 'personalBuild': checkIfIsPersonalBuild()
              }
          }
      }
  
      def checkIfIsBuildServer() {
          return 'some result'
      }
  
      def checkIfIsPersonalBuild() {
          return 'some result'
      }
  
  }
  </code></pre>
  
  <p>When I'm trying to apply it to some project, I get an error:</p>
  
  <pre><code>Could not find method jar() for arguments [com.example.gradle.ExamplePlugin$_apply_closure1@411e4f5e] on project ':SomeProject' of type org.gradle.api.Project.
  </code></pre>
  
  <p>I am reasonably sure this is some missing import. I don't have any idea how to determine what import it should be.</p>