Search Gradle plugins

Using the plugins DSL:

plugins {
  id("org.ajoberstar.git-publish") version "3.0.0"
}

Using legacy plugin application:

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("org.ajoberstar:gradle-git-publish:3.0.0")
  }
}

apply(plugin = "org.ajoberstar.git-publish")

Using the plugins DSL:

plugins {
  id "org.ajoberstar.git-publish" version "3.0.0"
}

Using legacy plugin application:

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "org.ajoberstar:gradle-git-publish:3.0.0"
  }
}

apply plugin: "org.ajoberstar.git-publish"

Learn how to apply plugins to subprojects