gradle 7之前的版本
apply plugin: 'maven'
uploadArchives {
repositories {
mavenDeployer {
repository(url: 'https://packages.aliyun.com/maven/repository/2146508-release-FrI2xT/') {
authentication(
userName: '************************',
password: '************'
)
}
snapshotRepository(url: 'https://packages.aliyun.com/maven/repository/2146508-snapshot-fV46Ee/') {
authentication(
userName: '************************',
password: '************'
)
}
pom.version = '$project.version'
pom.artifactId = '$artifactId'
pom.groupId = '$project.group'
}
}
}
gradle7.0之后的版本
apply plugin: 'maven-publish'
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
groupId = 'com.chd.huadian'
artifactId = 'huadian-parent'
//version = "0.0.1-SNAPSHOT"
version = "0.0.1-RELEASE"
}
}
repositories {
maven {
allowInsecureProtocol true
url = 'https://packages.aliyun.com/maven/repository/2146508-release-FrI2xT/'
credentials {
username = '123123123123'
password = '123123123'
}
}
}
}
}