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'