def publishArchivesType = rootProject.ext.config["publishArchivesType"] apply plugin: 'maven' if (publishArchivesType == 1) { uploadArchives { repositories { mavenDeployer { pom.project { groupId "com.didichuxing.doraemonkit" artifactId "dokit-okhttp-api" version rootProject.ext.android["jcenterArchivesVersionName"] } pom.withXml { def node = it.asElement() def nodeList = node.getElementsByTagName('dependency') nodeList.each { dependency -> dependency?.each { config -> if (config?.textContent == 'the-one-sdk') { config.parentNode.parentNode.removeChild(config.parentNode) } if (config?.textContent == 'onecar') { config.parentNode.parentNode.removeChild(config.parentNode) } } } } repository(url: "http://artifactory.intra.xiaojukeji.com/artifactory/libs-release/") { authentication(userName: "deployment", password: "deployment123") } snapshotRepository(url: "http://artifactory.intra.xiaojukeji.com/artifactory/libs-snapshot/") { authentication(userName: "deployment", password: "deployment123") } } } } } else if (publishArchivesType == 0) { def localRepoURL = uri(rootProject.ext.config["localRepoURL"]) uploadArchives { repositories { mavenDeployer { pom.project { groupId "com.didichuxing.doraemonkit" artifactId "dokit-okhttp-api" version rootProject.ext.android["jcenterArchivesVersionName"] } pom.withXml { def node = it.asElement() def nodeList = node.getElementsByTagName('dependency') nodeList.each { dependency -> dependency?.each { config -> if (config?.textContent == 'the-one-sdk') { config.parentNode.parentNode.removeChild(config.parentNode) } if (config?.textContent == 'onecar') { config.parentNode.parentNode.removeChild(config.parentNode) } } } } repository(url: localRepoURL) } } } }