Error:You must specify a URL for a Maven repository


(vijaymohite) #1

I have following script in gradle.build

buildscript {
repositories {
jcenter()
maven{
url:“https://plugins.gradle.org/m2/
}
}
dependencies {
classpath ‘com.github.jengelman.gradle.plugins:shadow:1.2.3’
}

This is giving me error ‘Error:You must specify a URL for a Maven repository.’


(James Justinic) #2

Your script is not actually specifying a URL for the Maven repository because you’ve mixed in map syntax with the closure.

maven {
    url: "https://plugins.gradle.org/m2/"
}

You need to remove the ‘:’ to correctly set the URL in the closure:

maven {
    url "https://plugins.gradle.org/m2/"
}

(vijaymohite) #3

Thanks a lot James. It is wokring