Skip to content

Explain why Kotlin modules are capped at Java 24 during Java 25 migration#1137

Merged
timtebeek merged 2 commits into
mainfrom
tim/java25-pom-set-to-24
Jun 22, 2026
Merged

Explain why Kotlin modules are capped at Java 24 during Java 25 migration#1137
timtebeek merged 2 commits into
mainfrom
tim/java25-pom-set-to-24

Conversation

@timtebeek

Copy link
Copy Markdown
Member

When migrating to Java 25, modules that compile Kotlin and depend on kotlin-stdlib older than 2.3 are capped at Java 24 (Kotlin <2.3 cannot target Java 25 bytecode), which previously happened silently and left users confused why their pom.xml showed 24 instead of 25. This adds CommentJava24KotlinCap, a Maven recipe that annotates the capped pom with an explanatory comment naming the kotlin-stdlib version found and the next step to reach Java 25. It is wired into UpgradeBuildToJava24 so it runs scoped behind the same Kotlin preconditions, right after the version is capped, and is idempotent on re-runs. A test in UpgradeToJava25Test covers the emitted comment.

…tion

When migrating to Java 25, modules that compile Kotlin and depend on
kotlin-stdlib older than 2.3 are capped at Java 24, since Kotlin <2.3
cannot target Java 25 bytecode. Previously this happened silently,
leaving users confused why their pom.xml showed 24 instead of 25.

Add CommentJava24KotlinCap, which annotates the capped Maven pom with an
explanatory comment naming the kotlin-stdlib version found and the next
step to reach Java 25. Wired into UpgradeBuildToJava24 so it runs scoped
behind the same Kotlin preconditions.
@timtebeek timtebeek merged commit 5cb24ac into main Jun 22, 2026
1 check passed
@timtebeek timtebeek deleted the tim/java25-pom-set-to-24 branch June 22, 2026 11:31
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenRewrite Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant