fix*_*xer 5 artifactory gradle
我正在尝试使用artifactory gradle插件解决配置阶段的依赖关系.
apply plugin: 'java'
apply plugin: 'com.jfrog.artifactory'
artifactory {
contextUrl = "${artifactory_contextUrl}"
...
resolve {
repository {
repoKey = 'repo'
username = "${artifactory_user}"
password = "${artifactory_password}"
maven = true
}
}
}
dependencies {
compile 'commons-lang:commons-lang:+'
}
task testCustomResolve {
logger.quiet configurations.getByName('compile').singleFile.absolutePath
}
Run Code Online (Sandbox Code Playgroud)
它给了我
无法解析配置':compile'的所有依赖项.无法解析外部依赖项commons-lang:commons-lang:+因为没有定义存储库.
它在执行阶段充当魅力
task testCustomResolve << {
logger.quiet configurations.getByName('compile').singleFile.absolutePath
}
Run Code Online (Sandbox Code Playgroud)
或者当我使用mavenCentral()时
repositories {
mavenCentral()
}
Run Code Online (Sandbox Code Playgroud)
如果您不需要发布到 Artifactory,我注意到如果您不使用语法,效果会更好artifactory {}。相反,尝试使用:
plugins {
id "com.jfrog.artifactory" version "4.4.10"
}
repositories {
mavenLocal()
maven {
url "${artifactory_contextUrl}/${artifactory_repo}"
credentials {
username = "${artifactory_user}"
password = "${artifactory_password}"
}
}
mavenCentral()
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3134 次 |
| 最近记录: |