Plugin tasks and task types syntax

Hello all,

I was wondering was there a difference between tasks that you can declare in a build script vs task type? If so, how would you know this difference?

One example would be the maven plugin’s uploadArchives task. I would like to display something like what you see below. But this doesn’t work.

 uploadZipFile(type: uploadArchives) { 
       repository { 
             mavenDeployer { 
                       // Specifics if zip file
             }
      }
}

But I am forced to simply declare the uploadArchives task instead of binding it to a specific task. Here’s an example of what I have now.

uploadArchives {
       repository { 
             mavenDeployer { 
                       // Specifics of zip file
             }
       }
}

uploadArchives is just the name of a task that’s added by the base plugin. Some of the core plugins list the tasks they add in their user guide section: http://gradle.org/docs/current/userguide/java_plugin.html

So when you’re doing:

uploadArchives {
  // stuff
}

You’re configuring an already existing task named ‘uploadArchives’. It has the type ‘Upload’.

So you could try,

task uploadZipFile(type: Upload) {
  // stuff
}

I was actually looking for docs for the maven plugin. Thanks for the help