I am using this plugin:
And below is a sample of my build.gradle
artifactory {
publish {
contextUrl = artifactoryUrl
repository {
repoKey = "repo-1"
username = System.getenv("ARTIFACTORY_USER") ?: project.findProperty("artifactory_user")
password = System.getenv("ARTIFACTORY_PASSWORD") ?: project.findProperty("artifactory_password")
}
defaults {
publications('ALL_PUBLICATIONS')
publishBuildInfo = false
}
}
}
The above task has a name artifactoryPublish
and when I run it, its publishing my artifact to repo-1 as defined above. However how should I modify this so it can also publish to repo-2 and repo-3? Is there a way to create a custom task and call the above task in a loop for each of the repos(repo-1, repo-2, repo-3)?
Note: I checked the docs for above plugin and I dont think they have a built-in way to publish to multiple repositories.