Gradle artifactory plugin cannot resolve configuration phase dependency

I am trying to resolve a dependency in the configuration phase with the 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

Failed to resolve all dependencies for ': compile' configuration. It is not possible to resolve the external dependency commons-lang: commons-lang: + because no repositories are defined.

It works like charm at runtime.

 task testCustomResolve << { logger.quiet configurations.getByName('compile').singleFile.absolutePath } 

or when i use mavenCentral ()

 repositories { mavenCentral() } 
+5
source share
1 answer

If you do not need to publish to Artifactory, I noticed that it works better if you do not 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() } 
0
source

Source: https://habr.com/ru/post/1210061/


All Articles