Plugin Dependencies Spec
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 anybuildscript {}
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
The builtin Gradle plugin implemented by org.gradle.api.plugins.antlr.AntlrPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.ApplicationPlugin.
The builtin Gradle plugin implemented by org.gradle.language.assembler.plugins.AssemblerPlugin.
The builtin Gradle plugin implemented by org.gradle.language.assembler.plugins.AssemblerLangPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.BasePlugin.
The builtin Gradle plugin implemented by org.gradle.platform.base.plugins.BinaryBasePlugin.
The builtin Gradle plugin implemented by org.gradle.api.reporting.plugins.BuildDashboardPlugin.
The builtin Gradle plugin implemented by org.gradle.buildinit.plugins.BuildInitPlugin.
The builtin Gradle plugin implemented by org.gradle.language.c.plugins.CPlugin.
The builtin Gradle plugin implemented by org.gradle.language.c.plugins.CLangPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.quality.CheckstylePlugin.
The builtin Gradle plugin implemented by org.gradle.nativeplatform.toolchain.plugins.ClangCompilerPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.quality.CodeNarcPlugin.
The builtin Gradle plugin implemented by org.gradle.platform.base.plugins.ComponentBasePlugin.
The builtin Gradle plugin implemented by org.gradle.language.base.plugins.ComponentModelBasePlugin.
The builtin Gradle plugin implemented by org.gradle.language.cpp.plugins.CppPlugin.
The builtin Gradle plugin implemented by org.gradle.language.cpp.plugins.CppApplicationPlugin.
The builtin Gradle plugin implemented by org.gradle.language.cpp.plugins.CppLangPlugin.
The builtin Gradle plugin implemented by org.gradle.language.cpp.plugins.CppLibraryPlugin.
The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.cpp.plugins.CppUnitTestPlugin.
The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.cunit.plugins.CUnitConventionPlugin.
The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.cunit.plugins.CUnitPlugin.
The builtin Gradle plugin implemented by org.gradle.api.distribution.plugins.DistributionPlugin.
The builtin Gradle plugin implemented by org.gradle.plugins.ear.EarPlugin.
The builtin Gradle plugin implemented by org.gradle.plugins.ide.eclipse.EclipsePlugin.
The builtin Gradle plugin implemented by org.gradle.plugins.ide.eclipse.EclipseWtpPlugin.
The embedded-kotlin
plugin.
The builtin Gradle plugin implemented by org.gradle.nativeplatform.toolchain.plugins.GccCompilerPlugin.
The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.googletest.plugins.GoogleTestConventionPlugin.
The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.googletest.plugins.GoogleTestPlugin.
The gradle-enterprise
plugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.GroovyPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.GroovyBasePlugin.
The builtin Gradle plugin implemented by org.gradle.plugin.devel.internal.precompiled.PrecompiledGroovyPluginsPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.HelpTasksPlugin.
The builtin Gradle plugin implemented by org.gradle.plugins.ide.idea.IdeaPlugin.
The builtin Gradle plugin implemented by org.gradle.api.publish.ivy.plugins.IvyPublishPlugin.
The builtin Gradle plugin implemented by org.gradle.testing.jacoco.plugins.JacocoPlugin.
The builtin Gradle plugin implemented by org.gradle.testing.jacoco.plugins.JacocoReportAggregationPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaBasePlugin.
The builtin Gradle plugin implemented by org.gradle.plugin.devel.plugins.JavaGradlePluginPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaLibraryPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaLibraryDistributionPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaPlatformPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.JavaTestFixturesPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.JvmEcosystemPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.JvmTestSuitePlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.JvmToolchainManagementPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.JvmToolchainsPlugin.
The kotlin-dsl
plugin.
The kotlin-dsl.base
plugin.
The kotlin-dsl.precompiled-script-plugins
plugin.
The builtin Gradle plugin implemented by org.gradle.language.base.plugins.LanguageBasePlugin.
The builtin Gradle plugin implemented by org.gradle.language.base.plugins.LifecycleBasePlugin.
The builtin Gradle plugin implemented by org.gradle.api.publish.maven.plugins.MavenPublishPlugin.
The builtin Gradle plugin implemented by org.gradle.nativeplatform.toolchain.plugins.MicrosoftVisualCppCompilerPlugin.
The builtin Gradle plugin implemented by org.gradle.nativeplatform.plugins.NativeComponentPlugin.
The builtin Gradle plugin implemented by org.gradle.nativeplatform.plugins.NativeComponentModelPlugin.
The builtin Gradle plugin implemented by org.gradle.language.objectivec.plugins.ObjectiveCPlugin.
The builtin Gradle plugin implemented by org.gradle.language.objectivec.plugins.ObjectiveCLangPlugin.
The builtin Gradle plugin implemented by org.gradle.language.objectivecpp.plugins.ObjectiveCppPlugin.
The builtin Gradle plugin implemented by org.gradle.language.objectivecpp.plugins.ObjectiveCppLangPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.quality.PmdPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.ProjectReportsPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.ProjectReportsPlugin.
The builtin Gradle plugin implemented by org.gradle.api.publish.plugins.PublishingPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.ReportingBasePlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.scala.ScalaPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.scala.ScalaBasePlugin.
The builtin Gradle plugin implemented by org.gradle.plugins.signing.SigningPlugin.
The builtin Gradle plugin implemented by org.gradle.nativeplatform.toolchain.internal.plugins.StandardToolChainsPlugin.
The builtin Gradle plugin implemented by org.gradle.language.swift.plugins.SwiftApplicationPlugin.
The builtin Gradle plugin implemented by org.gradle.language.swift.plugins.SwiftLibraryPlugin.
The builtin Gradle plugin implemented by org.gradle.swiftpm.plugins.SwiftPackageManagerExportPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.TestReportAggregationPlugin.
The builtin Gradle plugin implemented by org.gradle.testing.base.plugins.TestSuiteBasePlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.catalog.VersionCatalogPlugin.
The builtin Gradle plugin implemented by org.gradle.ide.visualstudio.plugins.VisualStudioPlugin.
The builtin Gradle plugin implemented by org.gradle.api.plugins.WarPlugin.
The builtin Gradle plugin implemented by org.gradle.language.rc.plugins.WindowsResourceScriptPlugin.
The builtin Gradle plugin implemented by org.gradle.language.rc.plugins.WindowsResourcesPlugin.
The builtin Gradle plugin implemented by org.gradle.buildinit.plugins.WrapperPlugin.
The builtin Gradle plugin implemented by org.gradle.ide.xcode.plugins.XcodePlugin.
The builtin Gradle plugin implemented by org.gradle.nativeplatform.test.xctest.plugins.XCTestConventionPlugin.
Functions
Applies the given Kotlin plugin module at the embedded version (currently 2.0.20).
Applies the given Kotlin plugin module.