title: Gradle clean<customTask> not working
body: <p>I have a custom task to do a Websphere EJBDeploy.  I have defined the inputs and ouputs, and get successful incremental compilation, but I can't get the automatically generated clean task to work properly.</p>
  
  <p>According to docs, for a custom task named "ejbDeploy" with a defined output, a cleanEjbDeploy <a href="http://mrhaki.blogspot.com/2010/10/gradle-goodness-automatic-clean-tasks.html" rel="nofollow">task should be automatically generated</a>.</p>
  
  <pre><code>Pattern: clean&lt;TaskName&gt;: Cleans the output files of a task.
  </code></pre>
  
  <p>So here's my custom task:</p>
  
  <pre><code>task ejbDeploy(dependsOn: 'jar'){
      srcFile = file(jar.archivePath)
      destDir = new File("build/ejbDeploy")
  
      inputs.file srcFile
      outputs.dir destDir
  
      def cp = project.files(
          project.sourceSets.main.output.classesDir,
          project.sourceSets.main.resources,
          project.configurations.runtime
          ).getAsPath()
  
      doLast{
          destDir.mkdirs()
  
          exec{
              executable = wasEjbDeploy
              workingDir = destDir
              args = [
                  jar.archivePath,
                  ".",
                  jar.archiveName,
                  "-cp",
                  cp
              ]
          }   
      }
  }
  </code></pre>
  
  <p>Anyone have any ideas as to why the clean rule isn't working?</p>
  
  <p>[Edit]</p>
  
  <p>Here's the full (anonymized) file contents (this has changed since initial question post):</p>
  
  <pre><code>version = '1.0-SNAPSHOT'
  group = 'com.company'
  
  buildscript {
      repositories {
          mavenLocal()
          mavenCentral()
      }
      dependencies {
          classpath group: 'name.benjaminAbbitt', name: 'WASEjbDeploy', version: '1.0-SNAPSHOT'
      }
  }
  
  apply plugin: 'java'
  apply plugin: 'eclipse'
  apply plugin: 'base'
  
  repositories {
      mavenCentral()
      mavenLocal()
  }
  
  dependencies {
      compile 'javax.mail:mail:1.4.5'
      compile 'log4j:log4j:1.2.16'
      compile files(fileTree(dir: 'lib', includes: ['*.jar']) )
  }
  
  task ejbDeploy(type:name.benjaminAbbitt.WASEjbDeploy, dependsOn: 'jar'){
      wasEjbDeployPath = wasEjbDeploy
  }
  </code></pre>
  
  <p>Here's the relevant chunk of "$gradle tasks"</p>
  
  <pre><code>build - Assembles and tests this project.
  buildDependents - Assembles and tests this project and all projects that depend
  on it.
  buildNeeded - Assembles and tests this project and all projects it depends on.
  classes - Assembles the main classes.
  clean - Deletes the build directory.
  jar - Assembles a jar archive containing the main classes.
  testClasses - Assembles the test classes.
  
  Documentation tasks
  -------------------
  javadoc - Generates Javadoc API documentation for the main source code.
  
  Help tasks
  ----------
  dependencies - Displays the dependencies of project ':project'.
  help - Displays a help message
  projects - Displays the sub-projects of project ':project'.
  properties - Displays the properties of project ':project'.
  tasks - Displays the tasks runnable from project ':project' (some of the
  displayed tasks may belong to subprojects).
  
  IDE tasks
  ---------
  cleanEclipse - Cleans all Eclipse files.
  eclipse - Generates all Eclipse files.
  
  Verification tasks
  ------------------
  check - Runs all checks.
  test - Runs the unit tests.
  
  Other tasks
  -----------
  ejbDeploy
  
  Rules
  -----
  Pattern: build&lt;ConfigurationName&gt;: Assembles the artifacts of a configuration.
  Pattern: upload&lt;ConfigurationName&gt;: Assembles and uploads the artifacts belongin
  g to a configuration.
  Pattern: clean&lt;TaskName&gt;: Cleans the output files of a task.
  
  To see all tasks and more detail, run with --all.
  
  BUILD SUCCESSFUL
  
  Total time: 3.321 secs
  </code></pre>