apply plugin: 'maven' def mavenRepositoryUrl = "http://nexus.yidianling.com/repository/AndroidReleases/" def getVersionName() { return hasProperty('VERSION_NAME') ? VERSION_NAME : rootProject.ext.ydlPublishVersion[project.getName()] } uploadArchives { configuration = configurations.archives repositories.mavenDeployer { repository(url: mavenRepositoryUrl) { authentication(userName: "admin", password: "fjoi#1+#@") } pom.project { artifactId project.getName().replace('_', "-") groupId "com.ydl" version getVersionName() packaging 'aar' //填写aar } } }