I’ve been futzing with this for awhile now, and I’ve finally narrowed down the behavior. I’m building a tarball, and uploading it to maven repositories. Everything works fine, with one exception: I can’t get both repositories to work at once.
uploadArchives {
repositories {
mavenDeployer {
repository(url: mavenLocal().url)
pom.groupId = rootProject.group
pom.artifactId = project.name
pom.version = rootProject.version
}
if (publishToNexus) {
mavenDeployer {
repository(url: nexusURL) {
authentication(userName: nexusUser, password: nexusPass)
}
pom.groupId = rootProject.group
pom.artifactId = project.name
pom.version = rootProject.version
}
}
}
}
The behavior is very simple – the last repository to be configured wins. The configuration above leads to an upload to nexus. If I put the mavenLocal repository block after the nexus one, then it will upload to mavenLocal. Is it possible to do both at once?