Search Gradle plugins

Using the plugins DSL:

plugins {
  id "io.gitlab.arturbosch.detekt" version "1.1.1"
}

Using legacy plugin application:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.1.1"
  }
}

apply plugin: "io.gitlab.arturbosch.detekt"

Using the plugins DSL:

plugins {
  id("io.gitlab.arturbosch.detekt") version "1.1.1"
}

Using legacy plugin application:

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.1.1")
  }
}

apply(plugin = "io.gitlab.arturbosch.detekt")

Learn how to apply plugins to subprojects