How to have multiple uploadArchives?

Sorry for the late reply.

Are there any examples on this? That page is only the documentation for the implementation, not how to use a task with it. The “task: Upload” page is only minimally more descriptive.

I’ve got the following in one task:

project.configurations.archives.artifacts.clear();
project.artifacts {
      archives file: project.file("build/libs/myartifact.jar")
}

And then this as a new task:

 project.tasks.create('myCustomUpload', Upload.class) {
    configuration project.configurations.archives
    repositories {
        mavenDeployer {
            repository(url: "$project.releasesUrl") {
                 authentication(userName: "$project.nexusUser", password: "$project.nexusPassword")
            }
        }
    }
}

But this gives me the following error:

Could not find method configuration() for arguments [configuration ‘:archives’] on task ‘:narArtifactUpload’ of type org.gradle.api.tasks.Upload.