gradle
8.4

# PluginDependenciesSpec

interface PluginDependenciesSpec(source)

The DSL for declaring plugins to use in a script.

In a build script, the `plugins {}` script block API is of this type. That is, you can use this API in the body of the plugins script block to declare plugins to be used for the script.

### Relationship with the apply() method

The `plugins {}` block serves a similar purpose to the apply method that can be used to apply a plugin directly to a `Project` object or similar. A key difference is that plugins applied via the `plugins {}` block are conceptually applied to the script, and by extension the script target. At this time there is no observable practical difference between the two approaches with regard to the end result.

### Strict Syntax

When used in a build script, the `plugins {}` block only allows a strict subset of the full build script programming language. Only the API of this type can be used, and values must be literal (e.g. constant strings, not variables). Interpolated strings are permitted for version, however replacement values must be sourced from Gradle properties. Moreover, the `plugins {}` block must be the first code of a build script. There is one exception to this, in that the `buildscript {}` block (used for declaring script dependencies) must precede it.

This implies the following constraints:

- Only id, alias, and alias method calls may be top level statements
- id calls may only be followed by a version and/or apply method call on the returned object
- id, version and apply methods must be called with a literal argument (i.e. not a variable)
- The `plugins {}` script block must follow any `buildscript {}` script block, but must precede all other logic in the script

### Available Plugins

Core Plugins

Core Gradle plugins are able to be applied using the `plugins {}` block. Core plugins must be specified without a version number, and can have a qualified or unqualified id. That is, the `java` plugin can be used via:

    plugins {
      id 'java'
    }

Content copied to clipboard

Or via:

    plugins {
      id 'org.gradle.java'
    }

Content copied to clipboard

Core Gradle plugins use the `org.gradle` namespace.

For the list of available core plugins for a particular Gradle version, please consult the user manual.

Community Plugins

Non-core plugins are available from the Gradle Plugin Portal. These plugins are contributed by users of Gradle to extend Gradle's functionality. Visit plugins.gradle.org to browse the available plugins and versions.

To use a community plugin, the fully qualified id must be specified along with a version.

### Settings Script Usage

When used in a settings script, this API sets the default version of a plugin, allowing build scripts to reference a plugin id without an associated version.

Within a settings script, the "Strict Syntax" rules outlined above do not apply. The `plugins` block may contain arbitrary code, and version Strings may contain property replacements. It is an error to call the `apply` method with a value other than `false` (the default).

## Properties

antlr
Link copied to clipboard
val PluginDependenciesSpec.antlr: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.antlr.AntlrPlugin.

application
Link copied to clipboard
val PluginDependenciesSpec.application: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.ApplicationPlugin.

assembler
Link copied to clipboard
val PluginDependenciesSpec.assembler: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.assembler.plugins.AssemblerPlugin.

assembler-lang
Link copied to clipboard
val PluginDependenciesSpec.assembler-lang: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.assembler.plugins.AssemblerLangPlugin.

base
Link copied to clipboard
val PluginDependenciesSpec.base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.BasePlugin.

binary-base
Link copied to clipboard
val PluginDependenciesSpec.binary-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.platform.base.plugins.BinaryBasePlugin.

build-dashboard
Link copied to clipboard
val PluginDependenciesSpec.build-dashboard: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.reporting.plugins.BuildDashboardPlugin.

build-init
Link copied to clipboard
val PluginDependenciesSpec.build-init: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.buildinit.plugins.BuildInitPlugin.

c
Link copied to clipboard
val PluginDependenciesSpec.c: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.c.plugins.CPlugin.

c-lang
Link copied to clipboard
val PluginDependenciesSpec.c-lang: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.c.plugins.CLangPlugin.

checkstyle
Link copied to clipboard
val PluginDependenciesSpec.checkstyle: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.quality.CheckstylePlugin.

clang-compiler
Link copied to clipboard
val PluginDependenciesSpec.clang-compiler: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.toolchain.plugins.ClangCompilerPlugin.

codenarc
Link copied to clipboard
val PluginDependenciesSpec.codenarc: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.quality.CodeNarcPlugin.

component-base
Link copied to clipboard
val PluginDependenciesSpec.component-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.platform.base.plugins.ComponentBasePlugin.

component-model-base
Link copied to clipboard
val PluginDependenciesSpec.component-model-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.base.plugins.ComponentModelBasePlugin.

cpp
Link copied to clipboard
val PluginDependenciesSpec.cpp: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.cpp.plugins.CppPlugin.

cpp-application
Link copied to clipboard
val PluginDependenciesSpec.cpp-application: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.cpp.plugins.CppApplicationPlugin.

cpp-lang
Link copied to clipboard
val PluginDependenciesSpec.cpp-lang: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.cpp.plugins.CppLangPlugin.

cpp-library
Link copied to clipboard
val PluginDependenciesSpec.cpp-library: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.cpp.plugins.CppLibraryPlugin.

cpp-unit-test
Link copied to clipboard
val PluginDependenciesSpec.cpp-unit-test: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.cpp.plugins.CppUnitTestPlugin.

cunit
Link copied to clipboard
val PluginDependenciesSpec.cunit: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.cunit.plugins.CUnitConventionPlugin.

cunit-test-suite
Link copied to clipboard
val PluginDependenciesSpec.cunit-test-suite: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.cunit.plugins.CUnitPlugin.

distribution
Link copied to clipboard
val PluginDependenciesSpec.distribution: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.distribution.plugins.DistributionPlugin.

ear
Link copied to clipboard
val PluginDependenciesSpec.ear: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.ear.EarPlugin.

eclipse
Link copied to clipboard
val PluginDependenciesSpec.eclipse: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.ide.eclipse.EclipsePlugin.

eclipse-wtp
Link copied to clipboard
val PluginDependenciesSpec.eclipse-wtp: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.ide.eclipse.EclipseWtpPlugin.

embedded-kotlin
Link copied to clipboard
val PluginDependenciesSpec.embedded-kotlin: PluginDependencySpec

The `embedded-kotlin` plugin.

gcc-compiler
Link copied to clipboard
val PluginDependenciesSpec.gcc-compiler: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.toolchain.plugins.GccCompilerPlugin.

google-test
Link copied to clipboard
val PluginDependenciesSpec.google-test: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.googletest.plugins.GoogleTestConventionPlugin.

google-test-test-suite
Link copied to clipboard
val PluginDependenciesSpec.google-test-test-suite: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.googletest.plugins.GoogleTestPlugin.

gradle-enterprise
Link copied to clipboard
val PluginDependenciesSpec.gradle-enterprise: PluginDependencySpec

The `gradle-enterprise` plugin.

groovy
Link copied to clipboard
val PluginDependenciesSpec.groovy: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.GroovyPlugin.

groovy-base
Link copied to clipboard
val PluginDependenciesSpec.groovy-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.GroovyBasePlugin.

groovy-gradle-plugin
Link copied to clipboard
val PluginDependenciesSpec.groovy-gradle-plugin: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugin.devel.internal.precompiled.PrecompiledGroovyPluginsPlugin.

help-tasks
Link copied to clipboard
val PluginDependenciesSpec.help-tasks: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.HelpTasksPlugin.

idea
Link copied to clipboard
val PluginDependenciesSpec.idea: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.ide.idea.IdeaPlugin.

ivy-publish
Link copied to clipboard
val PluginDependenciesSpec.ivy-publish: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.publish.ivy.plugins.IvyPublishPlugin.

jacoco
Link copied to clipboard
val PluginDependenciesSpec.jacoco: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.testing.jacoco.plugins.JacocoPlugin.

jacoco-report-aggregation
Link copied to clipboard
val PluginDependenciesSpec.jacoco-report-aggregation: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.testing.jacoco.plugins.JacocoReportAggregationPlugin.

java
Link copied to clipboard
val PluginDependenciesSpec.java: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaPlugin.

java-base
Link copied to clipboard
val PluginDependenciesSpec.java-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaBasePlugin.

java-gradle-plugin
Link copied to clipboard
val PluginDependenciesSpec.java-gradle-plugin: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugin.devel.plugins.JavaGradlePluginPlugin.

java-library
Link copied to clipboard
val PluginDependenciesSpec.java-library: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaLibraryPlugin.

java-library-distribution
Link copied to clipboard
val PluginDependenciesSpec.java-library-distribution: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaLibraryDistributionPlugin.

java-platform
Link copied to clipboard
val PluginDependenciesSpec.java-platform: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaPlatformPlugin.

java-test-fixtures
Link copied to clipboard
val PluginDependenciesSpec.java-test-fixtures: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaTestFixturesPlugin.

jdk-toolchains
Link copied to clipboard
val PluginDependenciesSpec.jdk-toolchains: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JdkToolchainsPlugin.

jvm-ecosystem
Link copied to clipboard
val PluginDependenciesSpec.jvm-ecosystem: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JvmEcosystemPlugin.

jvm-test-suite
Link copied to clipboard
val PluginDependenciesSpec.jvm-test-suite: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JvmTestSuitePlugin.

jvm-toolchain-management
Link copied to clipboard
val PluginDependenciesSpec.jvm-toolchain-management: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JvmToolchainManagementPlugin.

jvm-toolchains
Link copied to clipboard
val PluginDependenciesSpec.jvm-toolchains: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.JvmToolchainsPlugin.

kotlin-dsl
Link copied to clipboard
val PluginDependenciesSpec.kotlin-dsl: PluginDependencySpec

The `kotlin-dsl` plugin.

kotlin-dsl-base
Link copied to clipboard
val PluginDependenciesSpec.kotlin-dsl-base: PluginDependencySpec

The `kotlin-dsl.base` plugin.

kotlin-dsl-precompiled-script-plugins
Link copied to clipboard
val PluginDependenciesSpec.kotlin-dsl-precompiled-script-plugins: PluginDependencySpec

The `kotlin-dsl.precompiled-script-plugins` plugin.

language-base
Link copied to clipboard
val PluginDependenciesSpec.language-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.base.plugins.LanguageBasePlugin.

lifecycle-base
Link copied to clipboard
val PluginDependenciesSpec.lifecycle-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.base.plugins.LifecycleBasePlugin.

maven-publish
Link copied to clipboard
val PluginDependenciesSpec.maven-publish: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.publish.maven.plugins.MavenPublishPlugin.

microsoft-visual-cpp-compiler
Link copied to clipboard
val PluginDependenciesSpec.microsoft-visual-cpp-compiler: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.toolchain.plugins.MicrosoftVisualCppCompilerPlugin.

native-component
Link copied to clipboard
val PluginDependenciesSpec.native-component: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.plugins.NativeComponentPlugin.

native-component-model
Link copied to clipboard
val PluginDependenciesSpec.native-component-model: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.plugins.NativeComponentModelPlugin.

objective-c
Link copied to clipboard
val PluginDependenciesSpec.objective-c: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.objectivec.plugins.ObjectiveCPlugin.

objective-c-lang
Link copied to clipboard
val PluginDependenciesSpec.objective-c-lang: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.objectivec.plugins.ObjectiveCLangPlugin.

objective-cpp
Link copied to clipboard
val PluginDependenciesSpec.objective-cpp: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.objectivecpp.plugins.ObjectiveCppPlugin.

objective-cpp-lang
Link copied to clipboard
val PluginDependenciesSpec.objective-cpp-lang: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.objectivecpp.plugins.ObjectiveCppLangPlugin.

pmd
Link copied to clipboard
val PluginDependenciesSpec.pmd: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.quality.PmdPlugin.

project-report
Link copied to clipboard
val PluginDependenciesSpec.project-report: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.ProjectReportsPlugin.

project-reports
Link copied to clipboard
val PluginDependenciesSpec.project-reports: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.ProjectReportsPlugin.

publishing
Link copied to clipboard
val PluginDependenciesSpec.publishing: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.publish.plugins.PublishingPlugin.

reporting-base
Link copied to clipboard
val PluginDependenciesSpec.reporting-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.ReportingBasePlugin.

scala
Link copied to clipboard
val PluginDependenciesSpec.scala: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.scala.ScalaPlugin.

scala-base
Link copied to clipboard
val PluginDependenciesSpec.scala-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.scala.ScalaBasePlugin.

signing
Link copied to clipboard
val PluginDependenciesSpec.signing: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.plugins.signing.SigningPlugin.

standard-tool-chains
Link copied to clipboard
val PluginDependenciesSpec.standard-tool-chains: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.toolchain.internal.plugins.StandardToolChainsPlugin.

swift-application
Link copied to clipboard
val PluginDependenciesSpec.swift-application: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.swift.plugins.SwiftApplicationPlugin.

swift-library
Link copied to clipboard
val PluginDependenciesSpec.swift-library: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.swift.plugins.SwiftLibraryPlugin.

swiftpm-export
Link copied to clipboard
val PluginDependenciesSpec.swiftpm-export: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.swiftpm.plugins.SwiftPackageManagerExportPlugin.

test-report-aggregation
Link copied to clipboard
val PluginDependenciesSpec.test-report-aggregation: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.TestReportAggregationPlugin.

test-suite-base
Link copied to clipboard
val PluginDependenciesSpec.test-suite-base: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.testing.base.plugins.TestSuiteBasePlugin.

version-catalog
Link copied to clipboard
val PluginDependenciesSpec.version-catalog: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.catalog.VersionCatalogPlugin.

visual-studio
Link copied to clipboard
val PluginDependenciesSpec.visual-studio: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.ide.visualstudio.plugins.VisualStudioPlugin.

war
Link copied to clipboard
val PluginDependenciesSpec.war: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.api.plugins.WarPlugin.

windows-resource-script
Link copied to clipboard
val PluginDependenciesSpec.windows-resource-script: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.rc.plugins.WindowsResourceScriptPlugin.

windows-resources
Link copied to clipboard
val PluginDependenciesSpec.windows-resources: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.language.rc.plugins.WindowsResourcesPlugin.

wrapper
Link copied to clipboard
val PluginDependenciesSpec.wrapper: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.buildinit.plugins.WrapperPlugin.

xcode
Link copied to clipboard
val PluginDependenciesSpec.xcode: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.ide.xcode.plugins.XcodePlugin.

xctest
Link copied to clipboard
val PluginDependenciesSpec.xctest: PluginDependencySpec

The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.xctest.plugins.XCTestConventionPlugin.

## Functions

alias
Link copied to clipboard
open fun alias(notation: Provider<PluginDependency>): PluginDependencySpec
open fun alias(notation: ProviderConvertible<PluginDependency>): PluginDependencySpec
Adds a plugin dependency using a notation coming from a version catalog.
embeddedKotlin
Link copied to clipboard
@Incubating
fun PluginDependenciesSpec.embeddedKotlin(module: String): PluginDependencySpec

Applies the given Kotlin plugin module at the embedded version (currently 1.9.10).

id
Link copied to clipboard
abstract fun id(id: String): PluginDependencySpec
Add a dependency on the plugin with the given id.
kotlin
Link copied to clipboard
fun PluginDependenciesSpec.kotlin(module: String): PluginDependencySpec

Applies the given Kotlin plugin module.