This is an automated email from the ASF dual-hosted git repository.

vladimirsitnikov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jmeter.git


The following commit(s) were added to refs/heads/master by this push:
     new b68f8e1462 fix: bump Kotlin compiler to 2.2.20, use Kotlin 2.0.0 API
b68f8e1462 is described below

commit b68f8e14624bf99575933ef2e4390b864c92833b
Author: Vladimir Sitnikov <[email protected]>
AuthorDate: Mon Oct 13 19:52:53 2025 +0300

    fix: bump Kotlin compiler to 2.2.20, use Kotlin 2.0.0 API
    
    We target Kotlin 1.9 (released July 2023), so the projects using Kotlin 1.9+
    should be able to use JMeter.
---
 build-logic/jvm/build.gradle.kts                         |  4 ++--
 .../jvm/src/main/kotlin/build-logic.kotlin.gradle.kts    | 16 +++++++++-------
 build-logic/root-build/build.gradle.kts                  |  2 +-
 gradle.properties                                        |  4 ++--
 gradle/verification-metadata.xml                         | 10 ++++++++++
 .../jmeter/report/processor/Top5ErrorsSummaryDataTest.kt |  8 ++++----
 src/dist/src/dist/expected_release_jars.csv              |  2 +-
 .../protocol/http/sampler/HTTPSamplerBaseSchema.kt       |  2 +-
 xdocs/changes.xml                                        |  1 +
 9 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/build-logic/jvm/build.gradle.kts b/build-logic/jvm/build.gradle.kts
index 92d5e7eb71..85a87cf15e 100644
--- a/build-logic/jvm/build.gradle.kts
+++ b/build-logic/jvm/build.gradle.kts
@@ -25,7 +25,7 @@ dependencies {
     api("me.champeau.jmh:me.champeau.jmh.gradle.plugin:0.7.3")
     api("com.github.vlsi.crlf:com.github.vlsi.crlf.gradle.plugin:1.90")
     
api("com.github.vlsi.gradle-extensions:com.github.vlsi.gradle-extensions.gradle.plugin:1.90")
-    
api("org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.9.22")
-    
api("org.jetbrains.kotlin.kapt:org.jetbrains.kotlin.kapt.gradle.plugin:1.9.22")
+    
api("org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:2.2.20")
+    
api("org.jetbrains.kotlin.kapt:org.jetbrains.kotlin.kapt.gradle.plugin:2.2.20")
     
api("org.jetbrains.dokka-javadoc:org.jetbrains.dokka-javadoc.gradle.plugin:2.0.0")
 }
diff --git a/build-logic/jvm/src/main/kotlin/build-logic.kotlin.gradle.kts 
b/build-logic/jvm/src/main/kotlin/build-logic.kotlin.gradle.kts
index 01adbad0a6..e554f83a46 100644
--- a/build-logic/jvm/src/main/kotlin/build-logic.kotlin.gradle.kts
+++ b/build-logic/jvm/src/main/kotlin/build-logic.kotlin.gradle.kts
@@ -19,7 +19,9 @@ import com.github.vlsi.gradle.dsl.configureEach
 import com.github.vlsi.gradle.properties.dsl.props
 import org.jetbrains.kotlin.gradle.tasks.BaseKapt
 import org.jetbrains.kotlin.gradle.tasks.KaptGenerateStubs
-import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
+import org.jetbrains.kotlin.gradle.dsl.JvmTarget
+import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
+import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
 
 plugins {
     id("java-library")
@@ -44,18 +46,18 @@ kotlin {
     }
 }
 
-tasks.configureEach<KotlinCompile> {
+tasks.configureEach<KotlinJvmCompile> {
     if (gradle.startParameter.writeDependencyVerifications.isNotEmpty()) {
         enabled = false
     }
-    kotlinOptions {
+    compilerOptions {
         if (!name.startsWith("compileTest")) {
-            apiVersion = "kotlin.api".v
+            apiVersion = KotlinVersion.fromVersion("kotlin.api".v)
         }
-        freeCompilerArgs += "-Xjvm-default=all"
+        freeCompilerArgs.add("-Xjvm-default=all")
         val jdkRelease = buildParameters.targetJavaVersion.toString()
-        freeCompilerArgs += "-Xjdk-release=$jdkRelease"
-        kotlinOptions.jvmTarget = jdkRelease
+        freeCompilerArgs.add("-Xjdk-release=$jdkRelease")
+        jvmTarget = JvmTarget.fromTarget(jdkRelease)
     }
 }
 
diff --git a/build-logic/root-build/build.gradle.kts 
b/build-logic/root-build/build.gradle.kts
index d0a7975f54..121878e1d9 100644
--- a/build-logic/root-build/build.gradle.kts
+++ b/build-logic/root-build/build.gradle.kts
@@ -32,5 +32,5 @@ dependencies {
     
api("com.github.vlsi.gradle-extensions:com.github.vlsi.gradle-extensions.gradle.plugin:1.90")
     api("org.nosphere.apache.rat:org.nosphere.apache.rat.gradle.plugin:0.8.1")
     
api("org.jetbrains.gradle.plugin.idea-ext:org.jetbrains.gradle.plugin.idea-ext.gradle.plugin:1.1.7")
-    
api("org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.9.22")
+    
api("org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:2.2.20")
 }
diff --git a/gradle.properties b/gradle.properties
index 22f90ee6b3..02c6f4759f 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -42,8 +42,8 @@ systemProp.sonar.gradle.skipCompile=true
 jmeter.version=6.0.0
 
 # Plugins
-# Restrict uses of Kotlin APIs to 1.5 only, so projects that use Kotlin 1.5 
can use JMeter
-kotlin.api.version=1.5
+# Restrict uses of Kotlin APIs to 1.9 only, so projects that use Kotlin 2.0 
can use JMeter
+kotlin.api.version=1.9
 # See 
https://kotlinlang.org/docs/whatsnew14.html#explicit-api-mode-for-library-authors
 kotlin.explicitApi=true
 
diff --git a/gradle/verification-metadata.xml b/gradle/verification-metadata.xml
index da32981931..779887ac7d 100644
--- a/gradle/verification-metadata.xml
+++ b/gradle/verification-metadata.xml
@@ -594,11 +594,21 @@
             <sha256 
value="1cb4ecb933c919b2fbfd765efca5fe4907a08712e8c9942c33a208b2b169b18c" 
origin="Generated by Gradle" reason="Artifact is not signed"/>
          </artifact>
       </component>
+      <component group="org.jetbrains.kotlin.jvm" 
name="org.jetbrains.kotlin.jvm.gradle.plugin" version="2.2.20">
+         <artifact name="org.jetbrains.kotlin.jvm.gradle.plugin-2.2.20.pom">
+            <sha256 
value="4eb87defec3e7c2fece0e1a1ecdf22a70cdd61898262555b1d92e7c7b3f3b95d" 
origin="Generated by Gradle" reason="Artifact is not signed"/>
+         </artifact>
+      </component>
       <component group="org.jetbrains.kotlin.kapt" 
name="org.jetbrains.kotlin.kapt.gradle.plugin" version="1.9.22">
          <artifact name="org.jetbrains.kotlin.kapt.gradle.plugin-1.9.22.pom">
             <sha256 
value="1daf64ddd8e90a6aa8a831f3e649b4b094e72fe91df0dfd91b5b1ba1dcd54d54" 
origin="Generated by Gradle" reason="Artifact is not signed"/>
          </artifact>
       </component>
+      <component group="org.jetbrains.kotlin.kapt" 
name="org.jetbrains.kotlin.kapt.gradle.plugin" version="2.2.20">
+         <artifact name="org.jetbrains.kotlin.kapt.gradle.plugin-2.2.20.pom">
+            <sha256 
value="a7555d7d4625a985c9739a7f73a2b07f3bc5a7ba2c935e9b5d68e843999ae354" 
origin="Generated by Gradle" reason="Artifact is not signed"/>
+         </artifact>
+      </component>
       <component group="org.junit" name="junit-bom" version="5.11.4">
          <artifact name="junit-bom-5.11.4.pom">
             <sha256 
value="19d4b747b204805325b6334553296f986562277a4ac1cb5e593a5e4c4f5e4115" 
origin="Generated by Gradle"/>
diff --git 
a/src/core/src/test/kotlin/org/apache/jmeter/report/processor/Top5ErrorsSummaryDataTest.kt
 
b/src/core/src/test/kotlin/org/apache/jmeter/report/processor/Top5ErrorsSummaryDataTest.kt
index f47fb67abe..3a1ab62553 100644
--- 
a/src/core/src/test/kotlin/org/apache/jmeter/report/processor/Top5ErrorsSummaryDataTest.kt
+++ 
b/src/core/src/test/kotlin/org/apache/jmeter/report/processor/Top5ErrorsSummaryDataTest.kt
@@ -52,7 +52,7 @@ class Top5ErrorsSummaryDataTest {
         val input = listOf("A", "B", "C", "D", "E", "F")
         input.forEach { sut.registerError(it) }
         assertArrayEquals(
-            input.take(5).map { arrayOf(it, 1L) }.toTypedArray(),
+            input.take(5).map { arrayOf<Any>(it, 1L) }.toTypedArray(),
             sut.getTop5ErrorsMetrics(),
             "registerErrors $input, then call getTop5ErrorsMetrics"
         )
@@ -64,9 +64,9 @@ class Top5ErrorsSummaryDataTest {
         input.forEach { sut.registerError(it) }
         assertArrayEquals(
             arrayOf(
-                arrayOf("A", 3L),
-                arrayOf("B", 2L),
-                arrayOf("C", 1L)
+                arrayOf<Any>("A", 3L),
+                arrayOf<Any>("B", 2L),
+                arrayOf<Any>("C", 1L)
             ),
             sut.top5ErrorsMetrics,
             "registerErrors $input, then call getTop5ErrorsMetrics"
diff --git a/src/dist/src/dist/expected_release_jars.csv 
b/src/dist/src/dist/expected_release_jars.csv
index ef32d27e8d..28e2e92e4f 100644
--- a/src/dist/src/dist/expected_release_jars.csv
+++ b/src/dist/src/dist/expected_release_jars.csv
@@ -93,7 +93,7 @@
 249924,jtidy-r938.jar
 384581,junit-4.13.2.jar
 32033,kotlin-logging-jvm-2.0.5.jar
-1718956,kotlin-stdlib-1.9.22.jar
+1761444,kotlin-stdlib-2.2.20.jar
 959,kotlin-stdlib-jdk7-1.9.10.jar
 965,kotlin-stdlib-jdk8-1.9.10.jar
 1551152,kotlinx-coroutines-core-jvm-1.7.3.jar
diff --git 
a/src/protocol/http/src/main/kotlin/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBaseSchema.kt
 
b/src/protocol/http/src/main/kotlin/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBaseSchema.kt
index 5f2a31790a..89bb2f58e2 100644
--- 
a/src/protocol/http/src/main/kotlin/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBaseSchema.kt
+++ 
b/src/protocol/http/src/main/kotlin/org/apache/jmeter/protocol/http/sampler/HTTPSamplerBaseSchema.kt
@@ -79,7 +79,7 @@ public abstract class HTTPSamplerBaseSchema : 
TestElementSchema() {
     public val path: StringPropertyDescriptor<HTTPSamplerBaseSchema>
         by string("HTTPSampler.path")
 
-    public val proxy: HTTPSamplerProxyParamsSchema<HTTPSamplerBaseSchema> by 
HTTPSamplerProxyParamsSchema()
+    public val proxy: HTTPSamplerProxyParamsSchema<HTTPSamplerBaseSchema> by 
HTTPSamplerProxyParamsSchema<HTTPSamplerBaseSchema>()
 
     public val contentEncoding: StringPropertyDescriptor<HTTPSamplerBaseSchema>
         by string("HTTPSampler.contentEncoding", default = 
StandardCharsets.UTF_8.name())
diff --git a/xdocs/changes.xml b/xdocs/changes.xml
index eea3c92ab0..17d8185c33 100644
--- a/xdocs/changes.xml
+++ b/xdocs/changes.xml
@@ -64,6 +64,7 @@ Summary
   <h3>General</h3>
   <ul>
     <li><pr>6220</pr> Require Java 17 or later for running JMeter</li>
+    <li><pr>6550</pr> Require Kotlin 1.9 or later for running JMeter</li>
     <li><pr>6274</pr> Change references to old MySQL driver to new class 
<code>com.mysql.cj.jdbc.Driver</code></li>
     <li><issue>6352</issue> Calculate delays in Open Model Thread Group and 
Precise Throughput
         Timer relative to start of Thread Group instead of the start of the 
test.</li>

Reply via email to