Context URL Cannot Be Empty - Artifactory Gradle Plugin

I am trying to switch to the Artifactory Gradle plugin, which will be published in my local instance of Artifactory.

I have the latest version (default installation) running on localhost: 8081 / artifactory. I can check it with a web browser.

However, with my minimal example .. I get a " Context URL could not be found Error

Please note that I have specified all the required Artifactory configuration parameters - (as indicated in the Artifactory Gradle WebPage) .. including the context URL.

buildscript { repositories{ maven { url 'http://repo.jfrog.org/artifactory/gradle-plugins' } } dependencies{ classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:2.0.12'} } apply plugin: 'artifactory' artifactory { contextUrl = 'http://localhost:8081/artifactory' //The base Artifactory URL if not overridden by the publisher/resolver publish { repository { repoKey = 'integration-libs' //The Artifactory repository key to publish to username = 'admin' //The publisher user name password = 'password' } } resolve { repository { repoKey = 'libs-releases' //The Artifactory (preferably virtual) repository key to resolve from } } } 
+8
artifactory gradle
source share
1 answer

It looks like a weird mistake, and I'm not sure what causes it. I get it in some gradle build files, but others seem to work fine. I fixed it by specifying contextUrl again inside the publication element, so your script will now look like this:

 artifactory { contextUrl = 'http://localhost:8081/artifactory' //The base Artifactory URL if not overridden by the publisher/resolver publish { contextUrl = 'http://localhost:8081/artifactory' // <- this is the fix repository { repoKey = 'integration-libs' //The Artifactory repository key to publish to username = 'admin' //The publisher user name password = 'password' } } resolve { repository { repoKey = 'libs-releases' //The Artifactory (preferably virtual) repository key to resolve from } } } 

You may also need to define it again inside the permission element.

+5
source share

All Articles