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.2'
}
build.gradle.kts
plugins {
   id("dev.gradleplugins.java-gradle-plugin") version("1.2")
}

Extensions

The plugin provides the following extensions:

gradlePluginDevelopment() on RepositoryHandler

Adds the Gradle API redistribution repository to the project, e.g. https://repo.nokee.dev/release. 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.