apply plugin: 'maven-publish' publishing { publications { maven(MavenPublication) { groupId = MAVEN_GROUNP_ID artifactId = 'share' version = '1.0.2' } } repositories { maven { name = 'nexus' allowInsecureProtocol true url MAVEN_PUBLIC_URL credentials { username = MAVEN_USERNAME password = MAVEN_PASSWORD } def releasesRepoUrl = MAVEN_PUBLIC_URL def snapshotRepoUrl = MAVEN_SNAPSHOTS_URL url = version.endsWith('SNAPSHOT') ? snapshotRepoUrl : releasesRepoUrl } } } //uploadArchives { // repositories { // mavenDeployer{ // repository(url:MAVEN_PUBLIC_URL){ // authentication(userName: MAVEN_USERNAME, password: MAVEN_PASSWORD) // } // pom.groupId = MAVEN_GROUNP_ID // pom.artifactId = 'share' // pom.version = '1.0.2' // pom.packaging = 'aar' // } // } //}