Search Gradle plugins

Using the plugins DSL:

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

Using legacy plugin application:

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

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

Using the plugins DSL:

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

Using legacy plugin application:

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

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

Learn how to apply plugins to subprojects