它给了我
无法解析配置':compile'的所有依赖关系。 无法解析外部依赖项commons-lang:commons-lang:+因为没有定义存储库。
它可以作为魅力在执行阶段
任务testCustomResolve<< { logger.quiet configurations.getByName('compile')。singleFile.absolutePath }或者当我使用mavenCentral()时b
存储库{ mavenCentral()}解决方案
如果您不需要发布到Artifactory,我注意到,如果不使用 artifactory {} 语法,它会更好。请尝试使用:
插件{ idcom.jfrog.artifactoryversion4.4.10 $ b存储库{ mavenLocal() maven { url$ {artifactory_contextUrl} / $ {artifactory_repo} credentials { username =$ {artifactory_user} password =$ {artifactory_password}} } mavenCentral()}
I am trying to resolve dependency in configuration phase with artifactory gradle plugin.
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 }And it gives me
Could not resolve all dependencies for configuration ':compile'. Cannot resolve external dependency commons-lang:commons-lang:+ because no repositories are defined.
It works as a charm in execution phase
task testCustomResolve << { logger.quiet configurations.getByName('compile').singleFile.absolutePath }or when I use mavenCentral()
repositories { mavenCentral() }解决方案
In case you don't need to publish to Artifactory, I noticed that it works better if you don't use the artifactory {} syntax. Instead, try using:
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() }
更多推荐
Gradle artifactory插件无法解析配置阶段的依赖性
发布评论