Gradle (All Versions) This method works for all versions of gradle
Add the buildscript code at the beginning of your build.gradle file.
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "org.example.plugin:plugin:1.1.0"
}
}
apply plugin: "org.example.plugin"
Gradle (Versions 2.1+) This method only works for projects using Gradle 2.1 or later.
plugins {
id "org.example.plugin" version "1.1.0"
}