1.在项目的build.gradle下添加
allprojects {
repositories {
jcenter()
//使用自己的仓库
mavenLocal()
}
2.在library下添加
uploadArchives {
repositories.mavenDeployer {
/*url指定仓库路径*/
repository(url: "创建私有仓库的url") {
authentication(userName: "username", password: "password")
}
/*版本*/
pom.version = "版本号"
pom.artifactId = "artifactId"
pom.groupId = "groupId"
}
}
3.在gradlle下(android studio右边侧栏)找到library下的upload双击uploadArchives,此时已经构建完毕
### 使用私用仓库
在项目的build下添加
allprojects {
repositories {
maven {
url "创建私有仓库的url"
}
}
}
在dependencies下引用
compile 'groupId:artifactId:版本号'
allprojects {
repositories {
jcenter()
//使用自己的仓库
mavenLocal()
}
2.在library下添加
uploadArchives {
repositories.mavenDeployer {
/*url指定仓库路径*/
repository(url: "创建私有仓库的url") {
authentication(userName: "username", password: "password")
}
/*版本*/
pom.version = "版本号"
pom.artifactId = "artifactId"
pom.groupId = "groupId"
}
}
3.在gradlle下(android studio右边侧栏)找到library下的upload双击uploadArchives,此时已经构建完毕
### 使用私用仓库
在项目的build下添加
allprojects {
repositories {
maven {
url "创建私有仓库的url"
}
}
}
在dependencies下引用
compile 'groupId:artifactId:版本号'