Skip to content

Keep Maven Central in the Gradle init script repositories - #556

Closed
timtebeek wants to merge 1 commit into
masterfrom
tim/gradle-init-script-maven-central
Closed

timtebeek wants to merge 1 commit into
masterfrom
tim/gradle-init-script-maven-central

Conversation

@timtebeek

@timtebeek timtebeek commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

The init script that every recipe page generates (RunRecipe) and the "Running Rewrite on a Gradle project without modifying the build" guide list only the Code Genome Project under initscript { repositories }. Every released plugin version so far declares kotlin-stdlib as a dependency, and CGP doesn't serve it, so the script fails with:

Could not find org.jetbrains.kotlin:kotlin-stdlib:2.4.0.
  Required by:
      initialization script 'init.gradle' > org.openrewrite:plugin:7.41.0

openrewrite/rewrite-gradle-plugin#482 drops that dependency from future releases. Recipe pages, though, pin {{VERSION_REWRITE_GRADLE_PLUGIN}}, currently 7.41.0, so they need Maven Central until that pin moves past the fix. This adds mavenCentral() next to CGP in the Groovy and Kotlin variants of both snippets, and explains why in the guide.

yarn build passes.

Plugin versions up to 7.44.0 depend on kotlin-stdlib, which the Code
Genome Project does not serve, so an initscript that lists only CGP
fails to resolve the plugin.
@timtebeek

Copy link
Copy Markdown
Member Author

Part of a set of changes for openrewrite/rewrite-gradle-plugin#481. Related PRs:

@github-project-automation github-project-automation Bot moved this from In Progress to Ready to Review in OpenRewrite Oct 14, 2026
@timtebeek

Copy link
Copy Markdown
Member Author

No longer needed: plugin 7.44.1 drops kotlin-stdlib from its published metadata (openrewrite/rewrite-gradle-plugin#482), so an initscript with only the Code Genome Project resolves it. The docs now show 7.44.1, since rewrite-recipe-markdown-generator#392 resolves the plugin version from CGP.

@timtebeek timtebeek closed this Oct 15, 2026
@github-project-automation github-project-automation Bot moved this from Ready to Review to Done in OpenRewrite Oct 15, 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.

Recipe failed because artifact org.jetbrains.kotlin:kotlin-stdlib:2.4.0 was not found

2 participants