I am updating our build scripts to use the “maven-publish” plugin instead of the “maven” plugin. Previously we did:
apply plugin: 'maven'
repositories {
maven {
url "http://internal.repo"
}
}
uploadArchives {
repositories {
mavenDeployer {
snapshotRepository(url: "http://internal.repo/libs-snapshot-local") {
authentication(userName: 'admin', password: 'password')
}
repository(url: "http://internal.repo/libs-release-local") {
authentication(userName: 'admin', password: 'password')
}
}
}
}
The updated version looks like this:
apply plugin: 'maven-publish'
repositories {
maven {
url "http://internal.repo"
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
maven {
credentials {
username "admin"
password "password"
}
url
"http://internal.repo/libs-snapshot-local"
}
}
}
But there is no “snapshotRepository” element. So how do I setup snapshot/release repositories when using the maven-publish plugin?