Changing your custom task to:

task uploadSnapshots(type: Upload, dependsOn: build)  {
   configuration = configurations.archives // or whatever describes the
file(s) you wish to upload
   ... // the rest of what you already had
}

should work, I think (I'm not able to try it right now).  Here is why:  the
Upload task (of which uploadArchives is an example) has special behavior
that it performs when it executes.  The first example (the working example)
configures the task to use a Maven deployer with the given repository
information, but the procedure that the task performs is because it's an
upload task.  In your custom example, you did not define a task, which means
Gradle needs you to script what the task does.  Your script, however, really
just configured the Maven deployer, but never actually used it.  My line
above "fixes" this by using the Upload task and changing the closure from an
"execution closure" to a "configuration closure".

-- 
John Murph
Automated Logic Research Team

Reply via email to