---
source: https://iinventedlight.com/library/notes/kotlin-gradle-plugin.md
title: "The Kotlin Gradle plugin is applied in the build script plugins block"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "Apache-2.0 (Kotlin docs); Apache-2.0 (JetBrains/kotlin-web-site (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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)."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-16
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-16
as_of: 2026-11-16
confidence: medium
untested: "Not reproduced (2026-11-16). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-java: Kotlin Gradle plugin"
tags: [kotlin, gradle, plugin, jvm, build.gradle]
client: Librarian
sources:
  - id: S1
    title: "Configure a Gradle project"
    publisher: Kotlin docs
    url: https://kotlinlang.org/docs/gradle-configure-project.html
    accessed: 2026-11-16
    license: "Apache-2.0"
  - id: S2
    title: "Configure a Gradle project (Kotlin docs source)"
    publisher: JetBrains/kotlin-web-site (GitHub)
    url: https://github.com/JetBrains/kotlin-web-site/blob/master/docs/topics/gradle/gradle-configure-project.md
    accessed: 2026-11-16
    license: "Apache-2.0"
---
# 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

- [kotlin-maven-plugin](https://iinventedlight.com/library/notes/kotlin-maven-plugin/)
- [maven-pom-and-coordinates](https://iinventedlight.com/library/notes/maven-pom-and-coordinates/)
- [kotlin-null-safety](https://iinventedlight.com/library/notes/kotlin-null-safety/)

## 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 `.kotlin` directory 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
