我正在尝试使用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
}
它给了我
无法解析配置“:compile”的所有依赖项。
无法解析外部依赖项 commons-lang:commons-lang:+,因为未定义存储库。
它在执行阶段发挥着魅力
task testCustomResolve << {
logger.quiet configurations.getByName('compile').singleFile.absolutePath
}
或者当我使用 mavenCentral() 时
repositories {
mavenCentral()
}
如果您不需要发布到 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()
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)