Skip to content

MLE-31109 Bump kotlin plugin and remove kotlin.system.exitProcess - #1961

Merged
jonmille merged 3 commits into
developfrom
MLE-31109
Jul 30, 2026
Merged

MLE-31109 Bump kotlin plugin and remove kotlin.system.exitProcess#1961
jonmille merged 3 commits into
developfrom
MLE-31109

Conversation

@jonmille

Copy link
Copy Markdown

Bump kotlin plugin from 2.4.0 to 2.4.10
Removed imported instances of kotlin.system.exitProcess from com.squareup.okhttp3:okhttp:5.4.0 vulnerable dependency org.jetbrains.kotlin:kotlin-stdlib:2.2.21

Jira Item: https://progresssoftware.atlassian.net/browse/MLE-31109


Validating the kotlin-stdlib CVE fix

1. Verify dependency resolution (no MarkLogic server needed)

From the repo root, confirm kotlin-stdlib is forced to 2.4.10 across all subprojects:

./gradlew :marklogic-client-api:dependencies --configuration runtimeClasspath | grep kotlin-stdlib
./gradlew :ml-development-tools:dependencies --configuration runtimeClasspath | grep kotlin-stdlib

Expected output — every kotlin-stdlib line should show -> 2.4.10:

\--- org.jetbrains.kotlin:kotlin-stdlib:2.2.21 -> 2.4.10 (*)

2. Confirm exitProcess is gone from the main source

grep -r "exitProcess" ml-development-tools/src/main/

Expected: no results.

3. Build the project

./gradlew clean build -x test

Expected: BUILD SUCCESSFUL

4. Test the plugin end-to-end via the example-project

# Publish the snapshot artifacts to your local Maven repo
./gradlew publishToMavenLocal

# Run the plugin task in the example-project
cd ml-development-tools/src/test/example-project
../../../../../gradlew testProjectPath   # Linux/Mac
# or on Windows:
& C:\path\to\java-client-api\gradlew.bat testProjectPath

Expected: BUILD SUCCESSFUL and a generated DynamicPricer.java file appearing under src/main/java/org/example/inventory/ (can be deleted afterwards — it's gitignored).

Bump kotlin plugin from 2.4.0 to 2.4.10
Removed imported instances of kotlin.system.exitProcess from com.squareup.okhttp3:okhttp:5.4.0 vulnerable dependency org.jetbrains.kotlin:kotlin-stdlib:2.2.21
Copilot AI review requested due to automatic review settings July 29, 2026 19:49

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the ml-development-tools Gradle plugin’s Kotlin toolchain/dependency resolution to address a vulnerable transitive kotlin-stdlib (pulled in via OkHttp), and removes usages of kotlin.system.exitProcess from Kotlin entrypoints.

Changes:

  • Bumped org.jetbrains.kotlin.jvm plugin from 2.4.0 to 2.4.10 and removed the explicit kotlin-stdlib:2.2.21 dependency.
  • Forced org.jetbrains.kotlin:kotlin-stdlib:2.4.10 across all subprojects via root Gradle resolution strategy.
  • Replaced exitProcess usage in Kotlin main entrypoints with exceptions, and updated the example project to consume 8.2-SNAPSHOT artifacts.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ml-development-tools/build.gradle Updates Kotlin plugin version and removes explicit kotlin-stdlib dependency.
build.gradle Forces kotlin-stdlib 2.4.10 across subprojects to override vulnerable transitive version.
ml-development-tools/src/main/kotlin/com/marklogic/client/tools/fnmodinit.kt Removes exitProcess usage in CLI entrypoint.
ml-development-tools/src/main/kotlin/com/marklogic/client/tools/fnclassgen.kt Removes exitProcess usage in CLI entrypoint.
ml-development-tools/src/test/kotlin/com/marklogic/client/test/dbfunction/fntestgen.kt Replaces exitProcess with exceptions in test generator entrypoint.
ml-development-tools/src/test/example-project/build.gradle Updates example project to use 8.2-SNAPSHOT artifacts.
Comments suppressed due to low confidence (1)

ml-development-tools/src/test/kotlin/com/marklogic/client/test/dbfunction/fntestgen.kt:521

  • The new IllegalArgumentException for invalid args is immediately caught by the broad catch block, which prints a stack trace but then returns normally. This makes the JavaExec generateTests task succeed (exit code 0) even when argument validation or release validation fails, masking failures.
        else -> throw IllegalArgumentException("usage: fntestgen testDir [release]")
    }
  } catch (e: Exception) {
    e.printStackTrace()
  }

Comment thread ml-development-tools/src/test/example-project/build.gradle Outdated
@jonmille
jonmille merged commit fda5f74 into develop Jul 30, 2026
4 checks passed
@jonmille
jonmille deleted the MLE-31109 branch July 30, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants