apply plugin: 'maven-publish' publishing { publications { maven(MavenPublication) { afterEvaluate { artifact(tasks.getByName("bundleReleaseAar")) } groupId = MAVEN_GROUNP_ID artifactId = 'push-umeng' version = '1.1.0' pom.withXml{ def dependenciesNode = asNode().appendNode('dependencies') configurations.implementation.allDependencies.each { if (it.group != null && (it.name != null && "unspecified" != it.name) && it.version != null) { def dependencyNode = dependenciesNode.appendNode('dependency') dependencyNode.appendNode('groupId', it.group) dependencyNode.appendNode('artifactId', it.name) dependencyNode.appendNode('version', it.version) } } configurations.api.allDependencies.each { if (it.group != null && (it.name != null && "unspecified" != it.name) && it.version != null) { def dependencyNode = dependenciesNode.appendNode('dependency') dependencyNode.appendNode('groupId', it.group) dependencyNode.appendNode('artifactId', it.name) dependencyNode.appendNode('version', it.version) } } } } } 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) // } // snapshotRepository(url: MAVEN_SNAPSHOTS_URL) { // authentication(userName: MAVEN_USERNAME, password: MAVEN_PASSWORD) // } // pom.groupId = MAVEN_GROUNP_ID // pom.artifactId = 'push-umeng' // pom.version = '1.0.9' // pom.packaging = 'aar' // } // } //}