How can i publish the artifact to the two or more repositories at the same time?


(snowdream) #1

how can i set the gradle script so that i can publish the artifact to the two or more repositories at the same time?(not only the local repositories,may be all online repositories.)

uploadArchives {
    repositories {
        mavenDeployer {
            beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
              repository(url: sonatypeRepositoryUrl) {
                authentication(userName: nexusUsername, password: nexusPassword)
            }
              repository(url: githubRepositoryUrl)
        }
    }

(snowdream) #2

help


(Peter Niederwieser) #3

To upload to two repositories, you’ll need two ‘Upload’ tasks. You can configure the second ‘Upload’ task to upload the same configuration (‘archives’ in your case). For details see the Gradle Build Language Reference.