From 7a898356a20fe68623533e57bd64fa2987fbdfbf Mon Sep 17 00:00:00 2001 From: Jente Sondervorst Date: Mon, 2 Mar 2026 09:43:35 +0100 Subject: [PATCH 1/3] Document the generateRecipeCsv goal Add the new rewrite:generateRecipeCsv goal to the goals list and add a dedicated section describing its behavior. This goal is the Maven equivalent of the Gradle recipeCsvGenerate task, added in openrewrite/rewrite-maven-plugin#1113. --- docs/reference/rewrite-maven-plugin.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/reference/rewrite-maven-plugin.md b/docs/reference/rewrite-maven-plugin.md index 4f564df418..be47c61d13 100644 --- a/docs/reference/rewrite-maven-plugin.md +++ b/docs/reference/rewrite-maven-plugin.md @@ -18,6 +18,7 @@ The OpenRewrite Maven plugin offers these goals: * `mvn rewrite:dryRunNoFork` - Generate warnings to the console for any recipe that would make changes and generates a diff file in each Maven module's `target` folder. This variant does not fork the Maven life cycle and can be a more efficient choice when using Rewrite within a CI workflow when combined with other Maven goals. * `mvn rewrite:discover` - Generate a report of available recipes found on the classpath. * `mvn rewrite:typetable` - [Generate a type table](/authoring-recipes/multiple-versions#typetable-generation-for-maven-projects) to support multiple versions of a single library. +* `mvn rewrite:generateRecipeCsv` - Generate a `recipes.csv` marketplace file from the recipes found in this project. :::info _`rewrite`_ name-spaced properties can be used for substituting plugin properties: @@ -138,6 +139,18 @@ Note. the plugin scans the `compile`, `provided`, and `test` scopes for visitors To find out what recipes a rewrite module provides, see its documentation and the output of the `rewrite:discover` goal. ::: +## The "GenerateRecipeCsv" goal + +Execute `mvn rewrite:generateRecipeCsv` to generate a `recipes.csv` marketplace file from the recipes found in this project. This is the Maven equivalent of the Gradle `recipeCsvGenerate` task provided by the [OpenRewrite Gradle build plugin](https://github.com/openrewrite/rewrite-build-gradle-plugin). + +The goal scans compiled classes and resources in `target/classes/` for recipe definitions (both Java class-based and YAML declarative recipes) and writes the result to `src/main/resources/META-INF/rewrite/recipes.csv`. If an existing `recipes.csv` is present, generated data is merged into it, preserving any manually added entries such as custom category assignments. + +The goal automatically forks the Maven lifecycle to `process-classes`, so classes and resources will be compiled before scanning. + +:::info +For more details on the CSV format and how it is used by the Moderne CLI, see the [Moderne docs on the CSV recipe marketplace](https://docs.moderne.io/user-documentation/moderne-cli/references/recipes-csv). +::: + ## The "TypeTable" goal Execute `mvn rewrite:typetable` to [generate a type table](/authoring-recipes/multiple-versions#typetable-generation-for-maven-projects) to support multiple versions of a single library. From fa21ad6c15839d8ec256378572f2d16ee7ce13f6 Mon Sep 17 00:00:00 2001 From: Jente Sondervorst Date: Mon, 2 Mar 2026 13:44:51 +0100 Subject: [PATCH 2/3] Use renamed goal: recipeCsvGenerate --- docs/reference/rewrite-maven-plugin.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/rewrite-maven-plugin.md b/docs/reference/rewrite-maven-plugin.md index be47c61d13..a9a2456597 100644 --- a/docs/reference/rewrite-maven-plugin.md +++ b/docs/reference/rewrite-maven-plugin.md @@ -18,7 +18,7 @@ The OpenRewrite Maven plugin offers these goals: * `mvn rewrite:dryRunNoFork` - Generate warnings to the console for any recipe that would make changes and generates a diff file in each Maven module's `target` folder. This variant does not fork the Maven life cycle and can be a more efficient choice when using Rewrite within a CI workflow when combined with other Maven goals. * `mvn rewrite:discover` - Generate a report of available recipes found on the classpath. * `mvn rewrite:typetable` - [Generate a type table](/authoring-recipes/multiple-versions#typetable-generation-for-maven-projects) to support multiple versions of a single library. -* `mvn rewrite:generateRecipeCsv` - Generate a `recipes.csv` marketplace file from the recipes found in this project. +* `mvn rewrite:recipeCsvGenerate` - Generate a `recipes.csv` marketplace file from the recipes found in this project. :::info _`rewrite`_ name-spaced properties can be used for substituting plugin properties: @@ -139,9 +139,9 @@ Note. the plugin scans the `compile`, `provided`, and `test` scopes for visitors To find out what recipes a rewrite module provides, see its documentation and the output of the `rewrite:discover` goal. ::: -## The "GenerateRecipeCsv" goal +## The "recipeCsvGenerate" goal -Execute `mvn rewrite:generateRecipeCsv` to generate a `recipes.csv` marketplace file from the recipes found in this project. This is the Maven equivalent of the Gradle `recipeCsvGenerate` task provided by the [OpenRewrite Gradle build plugin](https://github.com/openrewrite/rewrite-build-gradle-plugin). +Execute `mvn rewrite:recipeCsvGenerate` to generate a `recipes.csv` marketplace file from the recipes found in this project. This is the Maven equivalent of the Gradle `recipeCsvGenerate` task provided by the [OpenRewrite Gradle build plugin](https://github.com/openrewrite/rewrite-build-gradle-plugin). The goal scans compiled classes and resources in `target/classes/` for recipe definitions (both Java class-based and YAML declarative recipes) and writes the result to `src/main/resources/META-INF/rewrite/recipes.csv`. If an existing `recipes.csv` is present, generated data is merged into it, preserving any manually added entries such as custom category assignments. From d8d8c3e95649e85e514e12b7254e64e15ac68fb3 Mon Sep 17 00:00:00 2001 From: Jente Sondervorst Date: Wed, 4 Mar 2026 09:41:26 +0100 Subject: [PATCH 3/3] Refactor rewrite-maven-plugin documentation Removed duplicate section for the 'TypeTable' goal and clarified the 'recipeCsvGenerate' goal description. --- docs/reference/rewrite-maven-plugin.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/reference/rewrite-maven-plugin.md b/docs/reference/rewrite-maven-plugin.md index a9a2456597..52a3e60f4c 100644 --- a/docs/reference/rewrite-maven-plugin.md +++ b/docs/reference/rewrite-maven-plugin.md @@ -139,9 +139,13 @@ Note. the plugin scans the `compile`, `provided`, and `test` scopes for visitors To find out what recipes a rewrite module provides, see its documentation and the output of the `rewrite:discover` goal. ::: +## The "TypeTable" goal + +Execute `mvn rewrite:typetable` to [generate a type table](/authoring-recipes/multiple-versions#typetable-generation-for-maven-projects) to support multiple versions of a single library. + ## The "recipeCsvGenerate" goal -Execute `mvn rewrite:recipeCsvGenerate` to generate a `recipes.csv` marketplace file from the recipes found in this project. This is the Maven equivalent of the Gradle `recipeCsvGenerate` task provided by the [OpenRewrite Gradle build plugin](https://github.com/openrewrite/rewrite-build-gradle-plugin). +Execute `mvn rewrite:recipeCsvGenerate` to generate a `recipes.csv` [marketplace](https://docs.moderne.io/user-documentation/moderne-cli/references/recipes-csv/) file from the recipes found in this project. This is the Maven equivalent of the Gradle `recipeCsvGenerate` task provided by the [OpenRewrite Gradle build plugin](https://github.com/openrewrite/rewrite-build-gradle-plugin). The goal scans compiled classes and resources in `target/classes/` for recipe definitions (both Java class-based and YAML declarative recipes) and writes the result to `src/main/resources/META-INF/rewrite/recipes.csv`. If an existing `recipes.csv` is present, generated data is merged into it, preserving any manually added entries such as custom category assignments. @@ -151,10 +155,6 @@ The goal automatically forks the Maven lifecycle to `process-classes`, so classe For more details on the CSV format and how it is used by the Moderne CLI, see the [Moderne docs on the CSV recipe marketplace](https://docs.moderne.io/user-documentation/moderne-cli/references/recipes-csv). ::: -## The "TypeTable" goal - -Execute `mvn rewrite:typetable` to [generate a type table](/authoring-recipes/multiple-versions#typetable-generation-for-maven-projects) to support multiple versions of a single library. - ## The "Run" goal Execute `mvn rewrite:run` to run the active recipes and apply the changes. This will write changes locally to your source files on disk. Afterward, review the changes, and when you are comfortable with the changes, commit them. The `run` goal generates warnings in the build log wherever it makes changes to source files.