android打包lib成为aar,并且推到远端maven
2018-08-01 本文已影响0人
带带太师兄
1.先在主项目的build.gradle 添加maven路径
allprojects {
repositories {
google()
jcenter()
maven{ url'http://192.168.2.13:8081/repository/android-snapshots/'}}
}
2.在子项目build.gradle顶部引入maven插件
applyplugin:'maven'
3.子项目添加task
uploadArchives {
repositories.mavenDeployer{
repository(url:"http://192.168.2.13:8081/repository/android-snapshots/")
{
authentication(userName:"admin",password:"admin123")
}
pom.version ="1.6.1-SNAPSHOT"
pom.artifactId ="chatui"
pom.groupId ="com.medtap.chatutil"
pom.name ="chatui"
pom.packaging ="aar"
}
}}
4.引入aar
compile'com.medtap.chatutil:chatui:1.6.1-SNAPSHOT'