上传aar包到Nexus私服

1. 添加maven-publish插件
apply plugin: 'maven-publish'

2. 脚本配置
指定了需要上传的aar包以及maven仓库的基本信息。

publishing {
    publications {
        mavenArr(MavenPublication) {
            groupId GROUP_ID
            version = VERSION_NAME
            artifactId ARTIFACT_ID
            // Tell maven to prepare the generated "*.jar" file for publishing
            artifact("$buildDir/outputs/aar/${project.getName()}-release.aar")
        }
    }
    repositories {
        maven {
            // 指定要上传的maven私服仓库
            url = MAVEN_LOCAL_PATH
            //认证用户和密码
            credentials {
                username localRespos.userName
                password localRespos.password
            }
        }
    }
}

3.发布上传

publish

你可能感兴趣的:(上传aar包到Nexus私服)