Search Gradle plugins

Using the plugins DSL:

plugins {
  id("org.gradle.samples") version "0.18.1-hotfix"
}

Using legacy plugin application:

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("org.gradle.guides:gradle-guides-plugin:0.18.1-hotfix")
  }
}

apply(plugin = "org.gradle.samples")

Using the plugins DSL:

plugins {
  id "org.gradle.samples" version "0.18.1-hotfix"
}

Using legacy plugin application:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "org.gradle.guides:gradle-guides-plugin:0.18.1-hotfix"
  }
}

apply plugin: "org.gradle.samples"

Learn how to apply plugins to subprojects