Skip to content

Bump Kotlin 2.0-2.2 to 2.3 so Kotlin modules can reach Java 25 - #1139

Merged
timtebeek merged 6 commits into
mainfrom
tim/bump-kotlin-versions
Jun 22, 2026
Merged

timtebeek merged 6 commits into
mainfrom
tim/bump-kotlin-versions

Conversation

@timtebeek

@timtebeek timtebeek commented Jun 22, 2026

Copy link
Copy Markdown
Member

What

This adds UpgradeKotlinForJava25, which bumps modules that are already on Kotlin 2.0, 2.1, or 2.2 up to the latest Kotlin 2.3 before the Java-version step runs, so those modules reach Java 25 instead of stalling at 24.

Why this is safe

The bump is scoped to the [2.0,2.3) band only:

  • Kotlin 2.0–2.2 → 2.3: same major version, already on the K2 compiler (default since 2.0). Minor bumps are source-compatible (with normal deprecation cycles), so this is safe to apply automatically.
  • Kotlin 1.x: left untouched. Crossing the K2 compiler default introduced in 2.0 is a real source-breaking change, so these modules stay capped at Java 24 (and keep the Explain why Kotlin modules are capped at Java 24 during Java 25 migration #1137 comment).

The existing UpgradeBuildToJava24 cap ([0,2.3)) is kept as-is and acts as a safety net: any module whose Kotlin version could not be bumped stays at Java 24 rather than being wrongly raised to 25.

How

UpgradeKotlinForJava25 is wired into UpgradeToJava25 ahead of the cap. Behind the same Kotlin preconditions (ModuleHasKotlinSource + ModuleHasDependency kotlin-stdlib* [2.0,2.3)) it:

  • upgrades all org.jetbrains.kotlin dependencies to 2.3.x (covers kotlin-stdlib, kotlin-reflect, kotlin-test, … and the kotlin.version property),
  • upgrades the kotlin-maven-plugin, and
  • upgrades the Gradle org.jetbrains.kotlin.* plugins.

The bump lands in the first cycle; the Java 25 upgrade applies in the next once the module is on 2.3.

Tests

UpgradeToJava25Test:

  • kotlin2xUpgradedToLatest2_3AndJava25 — a 2.2.0 module is bumped to 2.3.x and reaches Java 25.
  • kotlin1xCapsJavaVersionAt24WithoutBumpingKotlin — a 1.9.24 module is left on Kotlin 1.x and capped at Java 24.

recipes.csv regenerated via recipeCsvGenerate.

@github-project-automation github-project-automation Bot moved this to In Progress in OpenRewrite Jun 22, 2026
@timtebeek
timtebeek marked this pull request as draft June 22, 2026 11:43
# Conflicts:
#	src/main/resources/META-INF/rewrite/recipes.csv
#	src/test/java/org/openrewrite/java/migrate/UpgradeToJava25Test.java
Make CommentJava24KotlinCap self-healing (add at Java 24, remove once the
module reaches a higher version) and run it last via a new
CommentKotlinModulesCappedAtJava24 wrapper scoped to Kotlin modules, so the
explanation lands on every Kotlin module that truly stays at Java 24 without
leaving a stale comment on modules that reach Java 25.
@timtebeek
timtebeek marked this pull request as ready for review June 22, 2026 12:32
@timtebeek
timtebeek merged commit f3227f7 into main Jun 22, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Jun 22, 2026
@timtebeek
timtebeek deleted the tim/bump-kotlin-versions branch June 22, 2026 12:38
mergify Bot added a commit to robfrank/linklift that referenced this pull request Jul 17, 2026
…37.0 to 3.40.0 [skip ci]

Bumps [org.openrewrite.recipe:rewrite-migrate-java](https://github.com/openrewrite/rewrite-migrate-java) from 3.37.0 to 3.40.0.
Release notes

*Sourced from [org.openrewrite.recipe:rewrite-migrate-java's releases](https://github.com/openrewrite/rewrite-migrate-java/releases).*

> 3.40.0
> ------
>
> What's Changed
> --------------
>
> * Keep `\t` and `\f` escapes in UseTextBlocks to avoid incidental whitespace stripping by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1160](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1160)
> * Skip UseEnumSetOf empty conversion for static fields to avoid circular class-init ([#1157](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1157)) by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1161](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1161)
> * Skip `UseMapOf` for `LinkedHashMap`/`TreeMap` in the prose `put()` form ([#1163](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1163)) by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1165](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1165)
> * Skip AddMockitoJavaAgentToMavenSurefirePlugin when agent already configured in build/plugins by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1166](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1166)
> * Add RedundantUtf8Charset recipe to drop redundant UTF-8 from Files calls by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1167](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1167)
> * Fix Jakarta EE 10 web.xml migration by [`@​sakshichitnis27`](https://github.com/sakshichitnis27) in [openrewrite/rewrite-migrate-java#1159](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1159)
>
> New Contributors
> ----------------
>
> * [`@​sakshichitnis27`](https://github.com/sakshichitnis27) made their first contribution in [openrewrite/rewrite-migrate-java#1159](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1159)
>
> **Full Changelog**: <openrewrite/rewrite-migrate-java@v3.39.0...v3.40.0>
>
> 3.39.0
> ------
>
> What's Changed
> --------------
>
> * Make ExtractExplicitConstructorInvocationArguments templates context-free by [`@​knutwannheden`](https://github.com/knutwannheden) in [openrewrite/rewrite-migrate-java#1140](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1140)
> * Convert Javadoc `<br>` tags to Markdown line breaks by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1142](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1142)
> * Preserve angle brackets when converting `@param <T>` to Markdown by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1141](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1141)
> * Fix JavadocToMarkdown's handling of varargs and JDKs newer than the bytecode source/target compatibility by [`@​sambsnyd`](https://github.com/sambsnyd) in [openrewrite/rewrite-migrate-java#1143](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1143)
> * Move ReplaceUnusedVariablesWithUnderscore to Java best practices by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1144](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1144)
> * Extend Use{List,Set,Map}Of to recognise prose-statement chains by [`@​steve-aom-elliott`](https://github.com/steve-aom-elliott) in [openrewrite/rewrite-migrate-java#1145](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1145)
> * Skip `UseMapOf` when the anonymous `HashMap` is assigned to a concrete `HashMap` variable by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1149](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1149)
> * Fix jakarta.enterprise.concurrent-api version for EE9 and EE10 by [`@​evie-lau`](https://github.com/evie-lau) in [openrewrite/rewrite-migrate-java#1152](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1152)
> * Add recipe to replace jakarta jws-api with ws-api in EE10 by [`@​evie-lau`](https://github.com/evie-lau) in [openrewrite/rewrite-migrate-java#1151](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1151)
> * Upgrade maven-ejb-plugin alongside jakarta.ejb-api by [`@​evie-lau`](https://github.com/evie-lau) in [openrewrite/rewrite-migrate-java#1155](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1155)
> * Upgrade maven-ear-plugin for ee9 and ee11 by [`@​evie-lau`](https://github.com/evie-lau) in [openrewrite/rewrite-migrate-java#1156](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1156)
>
> **Full Changelog**: <openrewrite/rewrite-migrate-java@v3.38.0...v3.39.0>
>
> v3.38.0
> -------
>
> What's Changed
> --------------
>
> * use . instead # for FQN link in Markdown javadoc by [`@​barbulescu`](https://github.com/barbulescu) in [openrewrite/rewrite-migrate-java#1134](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1134)
> * Bump maven-pmd-plugin to 3.28.x for Java 25 support by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1136](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1136)
> * Explain why Kotlin modules are capped at Java 24 during Java 25 migration by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1137](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1137)
> * Preserve `@{argLine}` in AddSurefireFailsafeArgLine for JaCoCo coverage by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1138](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1138)
> * Add recipe to extract complex explicit constructor invocation arguments (JEP 513) by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1135](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1135)
> * Bump Kotlin 2.0-2.2 to 2.3 so Kotlin modules can reach Java 25 by [`@​timtebeek`](https://github.com/timtebeek) in [openrewrite/rewrite-migrate-java#1139](https://redirect.github.com/openrewrite/rewrite-migrate-java/pull/1139)
>
> **Full Changelog**: <openrewrite/rewrite-migrate-java@v3.37.0...v3.38.0>


Commits

* [`6584812`](openrewrite/rewrite-migrate-java@6584812) Fix Jakarta EE 10 web.xml migration ([#1159](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1159))
* [`3d0ad8f`](openrewrite/rewrite-migrate-java@3d0ad8f) OpenRewrite recipe best practices
* [`76925b9`](openrewrite/rewrite-migrate-java@76925b9) Add RedundantUtf8Charset recipe to drop redundant UTF-8 from Files calls ([#1167](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1167))
* [`c0d0f67`](openrewrite/rewrite-migrate-java@c0d0f67) Skip AddMockitoJavaAgentToMavenSurefirePlugin when agent already configured i...
* [`12386c8`](openrewrite/rewrite-migrate-java@12386c8) Skip UseMapOf for LinkedHashMap/TreeMap in prose put-statement form ([#1163](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1163)) (...
* [`ee2f4c4`](openrewrite/rewrite-migrate-java@ee2f4c4) OpenRewrite recipe best practices
* [`5f18964`](openrewrite/rewrite-migrate-java@5f18964) Skip UseEnumSetOf empty conversion for static fields to avoid circular class-...
* [`4cd2123`](openrewrite/rewrite-migrate-java@4cd2123) Keep \t and \f escapes in UseTextBlocks to avoid incidental whitespace stripp...
* [`16e662d`](openrewrite/rewrite-migrate-java@16e662d) Upgrade maven-ear-plugin for ee9 and ee11 ([#1156](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1156))
* [`b9f0360`](openrewrite/rewrite-migrate-java@b9f0360) Upgrade maven-ejb-plugin alongside jakarta.ejb-api ([#1155](https://redirect.github.com/openrewrite/rewrite-migrate-java/issues/1155))
* Additional commits viewable in [compare view](openrewrite/rewrite-migrate-java@v3.37.0...v3.40.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant