Contents

Use the Java Gradle Plugin development plugin to assist Gradle plugin development implemented in Java. It configures the project to compile Java code, adds the Gradle API dependency to the compileOnly configuration and performs validation of plugin metadata. It is a drop-in replacement for the Gradle java-gradle-plugin core plugin.

Usage

Example 1. Applying the Java Gradle Plugin Development plugin
build.gradle
plugins {
   id 'dev.gradleplugins.java-gradle-plugin' version '1.1'
}
build.gradle.kts
plugins {
   id("dev.gradleplugins.java-gradle-plugin") version("1.1")
}

Extensions

The plugin provides the following extensions:

gradlePluginDevelopment() on RepositoryHandler

Adds the Gradle API redistribution repository to the project, e.g. https://dl.bintray.com/gradle-plugins/distributions. Reads the redistributed Gradle API section to learn more.

gradleApi(version) on DependencyHandler

Creates a dependency on the Gradle API of the specified version, i.e. dev.gradleplugins:gradle-api:2.14.1. Reads the redistributed Gradle API section to learn more.

compatibility script block on GradlePluginDevelopmentExtension

Configures the Gradle plugin compatibility for the project, e.g. minimum supported Gradle version. Reads the minimum Gradle version section to learn more.

java script block on GradlePluginDevelopmentExtension

Configures the additional Javadoc and source JARs for the project.