我需要在gradle(Android应用)中配置 Artifact 。
我已经将所有脚本放在build.gradle中:
buildscript {
repositories {
jcenter()
maven {
url '.../artifactory/plugins-releases'
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
}
dependencies {
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:4.4.14"
}
}
apply plugin: "com.jfrog.artifactory"
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
artifactory {
contextUrl = "${artifactory_contextUrl}" //The base Artifactory URL if not overridden by the publisher/resolver
publish {
repository {
repoKey = 'libs-releases-local'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
resolve {
repository {
repoKey = 'libs-releases'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
}
当我尝试从此构件编译一个lib时,出现以下错误:
Failed to resolve: my-lib:1.0.0
最佳答案
com.jfrog.artifactory
插件用于将发布到 Artifact 中,而不是用于使用它。如果要使用它,则需要将其定义为构建的存储库。
关于android - 如何在gradle中添加人工库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42999329/