The Kotlin Gradle plugin is applied in the build script plugins block
Answer: To build a Kotlin project with Gradle, add the Kotlin Gradle plugin to your build also script file build.gradle(.kts) and configure the project's dependencies there. To apply the Kotlin Gradle plugin, use the plugins block from the Gradle plugins DSL.
Applying the plugin
In a Kotlin build script, the plugin id is written with kotlin("..."). For a JVM target, that is kotlin("jvm"). In a Groovy build script, the id is org.jetbrains.kotlin.<...> , for example org.jetbrains.kotlin.jvm. The Kotlin Gradle plugin (KGP) and Kotlin share the same version numbering. When you configure the project, check KGP compatibility with available Gradle versions.
JVM target and plugin data
To target the JVM, apply the Kotlin JVM plugin. By default, the plugin stores persistent project-specific data at the also root of the project, in the .kotlin directory also. Do not commit the .kotlin directory to version control. You can change that location with the kotlin.project.persistent.dir property in gradle.properties.
See also
Claims
- id: C1 claim: The Kotlin Gradle plugin is applied with the plugins block in the build script. source: S1 evidence: "To apply the Kotlin Gradle plugin, use the"
- id: C2 claim: To target the JVM, apply the Kotlin JVM plugin. source: S1 evidence: "To target the JVM, apply the Kotlin JVM plugin."
- id: C3 claim: The Kotlin Gradle plugin and Kotlin use the same version numbering. source: S2 evidence: "The Kotlin Gradle plugin (KGP) and Kotlin share the same version numbering."
- id: C4 claim: The .kotlin directory should not be committed to version control. source: S2 evidence: "Do not commit the
.kotlindirectory to version control."
Sources
- [S1] Configure a Gradle project. Kotlin docs. https://kotlinlang.org/docs/gradle-configure-project.html . License: Apache-2.0. Accessed 2026-11-16.
- [S2] Configure a Gradle project (Kotlin docs source). JetBrains/kotlin-web-site (GitHub). https://github.com/JetBrains/kotlin-web-site/blob/master/docs/topics/gradle/gradle-configure-project.md . License: Apache-2.0. Accessed 2026-11-16.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Kotlin docs, Configure a Gradle project, Apache-2.0 (https://raw.githubusercontent.com/JetBrains/kotlin-web-site/master/LICENSE); JetBrains/kotlin-web-site (GitHub), Configure a Gradle project, Apache-2.0 (https://raw.githubusercontent.com/JetBrains/kotlin-web-site/master/LICENSE). Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Kotlin docs, Configure a Gradle project, Apache-2.0 (https://raw.githubusercontent.com/JetBrains/kotlin-web-site/master/LICENSE); JetBrains/kotlin-web-site (GitHub), Configure a Gradle project, Apache-2.0 (https://raw.githubusercontent.com/JetBrains/kotlin-web-site/master/LICENSE).
Cite this
iinventedlight. 2026. "The Kotlin Gradle plugin is applied in the build script plugins block." iinventedlight Library, iil:note:dpwm22hq, version of 2026-11-16. https://iinventedlight.com/library/notes/kotlin-gradle-plugin/. License: CC-BY-4.0.
@misc{iil_note_dpwm22hq,
author = {{iinventedlight}},
title = {{The Kotlin Gradle plugin is applied in the build script plugins block}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-16},
url = {https://iinventedlight.com/library/notes/kotlin-gradle-plugin/},
note = {Permanent ID iil:note:dpwm22hq. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/kotlin-gradle-plugin.md.