PluginDependenciesSpec

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'
}

Or via:

plugins {
  id 'org.gradle.java'
}

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Link copied to clipboard

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

Functions

Link copied to clipboard
Adds a plugin dependency using a notation coming from a version catalog.
Link copied to clipboard

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

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

Applies the given Kotlin plugin module.