Why no pluginRepo in init.gradle?


(Juhan) #1

So I have many projects and I want to define repositories to all these projects in one central place.
init.gradle seems like it is designed for this where I can define repos for allprojects{}.

But when I want to use external plugin, I define it like that:
apply plugin: ‘com.github.johnrengelman.shadow’

buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath 'com.github.jengelman.gradle.plugins:shadow:1.2.3'
    }
}

Is there a possibility to get rid of defining plugin repo inside application build script?


(Stefan Oehme) #2

You can do the buildscript block inside the allprojects block.