Repository: GradleUp/shadow (kotlin)

Issue:
Trouble compiling against older kotlin versions
### Expected and Results

We'd expect at least support for kotlin versions in the Gradle 8 family, but we're seeing 
```
Class 'com.github.jengelman.gradle.plugins.shadow.ShadowJavaPlugin' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
```
while compiling against Kotlin 1.9.20 and Gradle 8.6

### Related environment and versions

_No response_

### Reproduction steps

1. Create a gradle plugin
2. Set the gradle version to 8.14
3. Set the kotlin gradle plugin version to 1.9.25
4. Observe issue

```
`/example/gradle-shadow-old-kotlin/plugin/src/main/kotlin/org/example/GradleShadowOldKotlinPlugin.kt:17:17 Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.1.0, but the compiler version 1.9.0 can read versions up to 2.0.0.
The class is loaded from /Users/cwalker/.gradle/wrapper/dists/gradle-9.0.0-milestone-8-bin/9sf1y14o9rs7csri8q5psfb7a/gradle-9.0.0-milestone-8/lib/kotlin-stdlib-2.1.21.jar!/kotlin/Unit.class
```

### Anything else?

_No response_

Pull request:
- Closes #1436.
- Closes #1446.

---

- [x] [CHANGELOG](https://github.com/GradleUp/shadow/blob/main/docs/changes/README.md)'s "Unreleased" section has been updated, if applicable.

Patch:
diff --git a/build.gradle.kts b/build.gradle.kts
index 896dc162c..e35e2c90e 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -36,8 +36,8 @@ kotlin {
   explicitApi()
   compilerOptions {
     // https://docs.gradle.org/current/userguide/compatibility.html#kotlin
-    @Suppress("DEPRECATION") // TODO: bump apiVersion to 2.0 to match Gradle 9.0
-    apiVersion = KotlinVersion.KOTLIN_1_8
+    apiVersion = KotlinVersion.KOTLIN_2_0
+    languageVersion = apiVersion
     jvmTarget = JvmTarget.JVM_11
     freeCompilerArgs.addAll(
       "-Xjvm-default=all",
diff --git a/docs/changes/README.md b/docs/changes/README.md
index 6cf66cde8..c41c2bb61 100644
--- a/docs/changes/README.md
+++ b/docs/changes/README.md
@@ -2,6 +2,11 @@
 
 ## [Unreleased](https://github.com/GradleUp/shadow/compare/9.0.0-beta14...HEAD) - 2025-xx-xx
 
+**Fixed**
+
+- Pin the plugin's Kotlin language level on 2.0. ([#1448](https://github.com/GradleUp/shadow/pull/1448))  
+  The language level used in `9.0.0-beta14` is 2.2, which may cause compatibility issues for the plugins depending on
+  Shadow.
 
 ## [9.0.0-beta14](https://github.com/GradleUp/shadow/releases/tag/9.0.0-beta14) - 2025-05-28
 
diff --git a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformer.kt b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformer.kt
index 4e6d6f377..4f331a0c5 100644
--- a/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformer.kt
+++ b/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformer.kt
@@ -238,7 +238,6 @@ public open class PropertiesFileTransformer @Inject constructor(
     public companion object {
       @JvmStatic
       public fun from(value: String): MergeStrategy {
-        @OptIn(ExperimentalStdlibApi::class)
         return entries.find { it.name.equals(value, ignoreCase = true) }
           ?: throw IllegalArgumentException("Unknown merge strategy: $value")
       }


Test patch:
diff --git a/src/documentTest/kotlin/com/github/jengelman/gradle/plugins/shadow/DocCodeSnippetTest.kt b/src/documentTest/kotlin/com/github/jengelman/gradle/plugins/shadow/DocCodeSnippetTest.kt
index 1af8dc917..d5e06ffc9 100644
--- a/src/documentTest/kotlin/com/github/jengelman/gradle/plugins/shadow/DocCodeSnippetTest.kt
+++ b/src/documentTest/kotlin/com/github/jengelman/gradle/plugins/shadow/DocCodeSnippetTest.kt
@@ -10,7 +10,6 @@ import org.junit.jupiter.api.io.TempDir
 
 class DocCodeSnippetTest {
 
-  @OptIn(ExperimentalStdlibApi::class)
   @TestFactory
   fun provideDynamicTests(@TempDir root: Path): List<DynamicTest> {
     val langExecutables = DslLang.entries.map { executor ->