我在服务器上安装了Artifactory开源软件,并手动上传了一个Android AAR库。
在gradle文件中,我设置了如下配置。
buildscript {
dependencies { classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release" }
repositories {
maven {
credentials {
username = artifactory_username
password = artifactory_password
}
url "https://.../artifactory/libs-release"
}
}
}
allprojects{
apply plugin: org.jfrog.gradle.plugin.artifactory.ArtifactoryPlugin
artifactory {
resolve {
contextUrl = "https://.../artifactory"
repoKey = 'libs-global'
username = artifactory_username
password = artifactory_password
}
}
}
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:latest.release"
}
}
apply plugin: "com.jfrog.artifactory"
如何在android项目中下载或实现我的AAR库?
示例:
implementation 'com.google.code.gson:gson:2.8.6'
1条答案
按热度按时间91zkwejq1#
你需要像这样在build.gradle(project)文件中添加你的URL:
然后你只需要在dependencies中添加你的dependency。