maven_push.gradle 786 Bytes
apply plugin: 'maven'

uploadArchives() {
    repositories {
        mavenDeployer {
            def lib = moudle_user
            //发布环境(正式/测试)
            android.defaultPublishConfig lib.debug ? "debug" : "release"
            //发布渠道(地址/账号)
            repository(url: maven.mavenMixedUrl) {
                authentication(userName: maven.mavenUserName, password: maven.mavenPwd)
            }
            //发布信息(包名/别名/版本)
            pom.project {
                groupId lib.packeg
                artifactId lib.name
                version = lib.debug ? lib.version.concat("-SNAPSHOT") : lib.version
            }
            pom.whenConfigured { pom ->
                pom.dependencies.clear()
            }

        }
    }
}