Resolve the Gradle plugin from the Code Genome Project - #536
Merged
Conversation
The Gradle plugin is moving off the Gradle Plugin Portal, and its dependencies are already gone from it: org.openrewrite:plugin 7.40.0 and 7.41.0 declare org.openrewrite:rewrite-bom:8.91.0, which the portal's m2 mirror cannot serve because it is no longer on Maven Central. Declaring the Code Genome Project in the project's repositories is not enough, since that is the wrong classpath for plugin resolution. Every Gradle snippet now declares it in pluginManagement as well, and reads credentials from gradle.properties rather than inlining them. Init scripts run before any project is configured and so cannot read gradle.properties; those use environment variables instead.
# Conflicts: # docs/authoring-recipes/recipe-development-environment.md # docs/authoring-recipes/recipe-testing.md # docs/authoring-recipes/refaster-recipes.md # docs/authoring-recipes/writing-kotlin-recipes.md # docs/reference/snapshot-instructions.md # docs/running-recipes/popular-recipe-guides/authoring-declarative-yaml-recipes.md
timtebeek
marked this pull request as ready for review
August 27, 2026 15:04
mike-solomon
approved these changes
Aug 27, 2026
mike-solomon
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the work on this! One minor comment below.
I do recognize that there is a lot of duplicated information throughout this - in the future we may want to investigate a partial that can be plugged in to various pages - but I don't think it's necessary right now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a live breakage, not just doc residue
Following
getting-started.mdexactly does not work today. Verified with Gradle 8.14.3:plugins { id 'org.openrewrite.rewrite' version '7.41.0' } repositories { mavenCentral() /* + CGP, as the docs currently show */ }The marker and the plugin jar are still on the Portal, but
org.openrewrite:plugin'sruntimeElementsdeclaresorg.openrewrite:rewrite-bom:8.91.0, and that is 404 on both the Portal's m2 mirror and Maven Central (last version on either is 8.90.4). It resolves on the buildscript classpath, so the project-levelrepositoriesblock the earlier PRs added does not help.Confirmed three ways:
rewriteDiscoversucceeds on Portal +mavenCentral()alone.rewrite-bom:8.91.0from a repository inpluginManagement.repositoriesgets past the classpath; the only remaining failure is the runtime core-lib resolution that project-level CGP already covers.So Gradle needs the Code Genome Project in two places, and this PR adds the missing one everywhere.
What changed
src/components/RunRecipe/index.tsx— one edit covering every generated recipe page. Adds asettings.gradlepluginManagementstep and agradle.propertiesstep to the Gradle tab, and moves the init scripts'classpathresolution fromplugins.gradle.org/m2to the Code Genome Project.running-recipes/getting-started.md,reference/gradle-plugin-configuration.md—pluginManagementalongside the existing projectrepositories, with an explanation of why both are needed.running-rewrite-on-a-gradle-project-without-modifying-the-build.md— Code Genome Project insideinitscript { repositories }, Groovy and Kotlin.running-text-based-recipes.md,running-rewrite-on-an-infrastructure-as-code-project.md,authoring-recipes/data-tables.md,popular-recipe-guides/automatically-fix-checkstyle-violations.md,authoring-declarative-yaml-recipes.md— same two-place fix.authoring-recipes/recipe-development-environment.md,recipe-testing.md,refaster-recipes.md,writing-kotlin-recipes.md— recipe-module builds had norepositoriesblock at all for the rewrite modules they compile against.reference/latest-versions-of-every-openrewrite-module.md— drops the claim that the Gradle plugin is published to the Plugin Portal.reference/snapshot-instructions.md— Gradle snapshots now come from the Code Genome Project.reference/building-openrewrite-from-source.md— the isolated-environment allowlist needed a Code Genome Project mirror entry.Credentials
Gradle snippets now read
codeGenomeUsername/codeGenomeTokenviaproviders.gradleProperty(...)instead of inliningUSERNAME/TOKEN, with guidance to keep them in~/.gradle/gradle.properties(orORG_GRADLE_PROJECT_*env vars in CI).Init scripts are the exception: they run before any project is configured and cannot read
gradle.properties, so those useCODE_GENOME_USERNAME/CODE_GENOME_TOKENenvironment variables. Called out inline where it appears.Assumptions to confirm
plugins { id("org.openrewrite.rewrite") version "…" }resolving from a plain Maven repository requires theorg.openrewrite.rewrite:org.openrewrite.rewrite.gradle.pluginmarker POM to be published there alongsideorg.openrewrite:plugin. I could not verify this — every path under/mavenreturns 401 whether or not it exists. If markers are not published, these snippets need aresolutionStrategyor abuildscriptblock instead.https://artifacts.codegenomeproject.org/mavenURL (there is no separate/maven-snapshotsor/snapshotsendpoint — both 404).rewrite-bomon the plugin'sruntimeElementsintended? If it gets shaded or dropped upstream, thepluginManagementrequirement goes away for the plugin classpath, though it would still be needed once the plugin itself leaves the Portal.Verification
yarn buildwithCI_STRICT_LINKS=1passes locally, and the rendered recipe pages were spot-checked. All Gradle snippets in this PR were syntax-checked by running them through Gradle 8.14.3.