rewrite:discover
Full name:
org.openrewrite.maven:rewrite-maven-plugin:6.71.0:discover
Description:
Generate a report of the available recipes and styles found on the classpath.
Can also be used to display information about a specific recipe. For example:
./mvnw rewrite:discover -Ddetail=true -Drecipe=org.openrewrite.java.format.AutoFormat
Attributes:
- Executes as an aggregator goal.
- The goal is thread-safe and supports parallel builds.
Optional Parameters
| Name | Type | Since | Description |
|---|---|---|---|
<activeRecipes> |
LinkedHashSet<String> |
- |
The recipes to run, by the name they are given in their specs.openrewrite.org/v1beta/recipe resource. No recipe runs unless it is listed here.User Property: rewrite.activeRecipes |
<activeStyles> |
LinkedHashSet<String> |
- |
The styles to apply, by the name they are given in their specs.openrewrite.org/v1beta/style resource. No style is applied unless it is listed here.User Property: rewrite.activeStyles |
<additionalPlainTextMasks> |
LinkedHashSet<String> |
- |
Files to parse as plain text in addition to the default masks, as glob patterns like those of exclusions. For example, **/*.ext.User Property: rewrite.additionalPlainTextMasks |
<checkstyleConfigFile> |
String |
- |
A Checkstyle configuration file to derive the coding style from, instead of detecting it from the Checkstyle plugin. User Property: rewrite.checkstyleConfigFileAlias: checkstyleConfigFile |
<checkstyleDetectionEnabled> |
boolean |
- |
Whether to derive the coding style from the configuration of the Checkstyle plugin, when the build uses it. Default: trueUser Property: rewrite.checkstyleDetectionEnabledAlias: checkstyleDetectionEnabled |
<configLocation> |
String |
- |
The OpenRewrite YAML configuration file, as a path or an http(s) URL. A relative path is resolved against the directory of each module, so prefixing it with ${maven.multiModuleProjectDirectory} has every module use the same file at the root of the repository.Default: ${maven.multiModuleProjectDirectory}/rewrite.ymlUser Property: rewrite.configLocationAlias: configLocation |
<detail> |
boolean |
- |
Whether to show the display name, description and options of each recipe. Default: falseUser Property: detail |
<exclusions> |
LinkedHashSet<String> |
- |
Paths not to parse, as PathMatcher glob patterns relative to the root of the repository, where ** matches any number of directories and * a single directory or file name. For example, docs/**.User Property: rewrite.exclusions |
<failOnInvalidActiveRecipes> |
boolean |
- |
Whether to fail the build when an active recipe, or a recipe it includes, is not configured correctly. This may default to true in the future.Default: falseUser Property: rewrite.failOnInvalidActiveRecipesAlias: failOnInvalidActiveRecipes |
<plainTextMasks> |
LinkedHashSet<String> |
- |
The files to parse as plain text, as glob patterns like those of exclusions, replacing the default masks. The defaults cover common text files without a dedicated parser, such as Markdown, shell scripts and Dockerfiles. Exclusions take precedence over plain text masks, and additionalPlainTextMasks has no effect when this is set.User Property: rewrite.plainTextMasks |
<pomCacheDirectory> |
String |
- |
The directory to create the .rewrite-cache directory with cached POMs and Maven metadata in. Defaults to the user's home directory. Deleting the cache is safe, as it is populated again on the next run.User Property: rewrite.pomCacheDirectoryAlias: pomCacheDirectory |
<pomCacheEnabled> |
boolean |
- |
Whether to cache downloaded POMs and Maven metadata on disk, in pomCacheDirectory. When disabled, an in-memory cache is used instead, which makes runs slower on projects with deep dependency trees.Default: trueUser Property: rewrite.pomCacheEnabledAlias: pomCacheEnabled |
<recipe> |
String |
- |
The name of a recipe to show, instead of every recipe. For example, ./mvnw rewrite:discover -Ddetail=true -Drecipe=org.openrewrite.java.format.AutoFormat.User Property: recipe |
<recipeArtifactCoordinates> |
LinkedHashSet<String> |
- |
Recipe artifacts to add, as groupId:artifactId:version coordinates, instead of or in addition to plugin dependencies. These are resolved from the repositories of the project rather than its plugin repositories.User Property: rewrite.recipeArtifactCoordinates |
<recursion> |
int |
- |
How many levels of the recipes that a recipe includes to show. Default: 0User Property: recursion |
<resolvePropertiesInYaml> |
boolean |
- |
Whether to resolve Maven properties, like ${project.artifactId}, in the YAML configuration file.Default: trueUser Property: rewrite.resolvePropertiesInYaml |
<rewriteSkip> |
boolean |
- |
Whether to skip the execution of the plugin, to disable it without removing its configuration. Default: falseUser Property: rewrite.skip |
<runPerSubmodule> |
boolean |
- |
Whether to run recipes on each module separately, rather than once on all the modules of the build. Default: falseUser Property: rewrite.runPerSubmoduleAlias: runPerSubmodule |
<sizeThresholdMb> |
int |
- |
The size in megabytes above which files other than Java sources are not parsed. Default: 10User Property: sizeThresholdMb |
<skipMavenParsing> |
boolean |
- |
Whether to skip parsing pom.xml files, and the POMs they inherit from, as source files. This can make runs faster when no recipe changes POMs.Default: falseUser Property: skipMavenParsing |
Parameter Details
<activeRecipes>
The recipes to run, by the name they are given in their
specs.openrewrite.org/v1beta/recipe resource. No recipe runs unless it is listed here.- Type:
java.util.LinkedHashSet<java.lang.String> - Required:
No - User Property:
rewrite.activeRecipes
<activeStyles>
The styles to apply, by the name they are given in their
specs.openrewrite.org/v1beta/style resource. No style is applied unless it is listed here.- Type:
java.util.LinkedHashSet<java.lang.String> - Required:
No - User Property:
rewrite.activeStyles
<additionalPlainTextMasks>
Files to parse as plain text in addition to the default masks, as glob patterns like those of
exclusions. For example, **/*.ext.- Type:
java.util.LinkedHashSet<java.lang.String> - Required:
No - User Property:
rewrite.additionalPlainTextMasks
<checkstyleConfigFile>
A Checkstyle configuration file to derive the coding style from, instead of detecting it from the Checkstyle plugin.
- Type:
java.lang.String - Required:
No - User Property:
rewrite.checkstyleConfigFile - Alias:
checkstyleConfigFile
<checkstyleDetectionEnabled>
Whether to derive the coding style from the configuration of the Checkstyle plugin, when the build uses it.
- Type:
boolean - Required:
No - User Property:
rewrite.checkstyleDetectionEnabled - Default:
true - Alias:
checkstyleDetectionEnabled
<configLocation>
The OpenRewrite YAML configuration file, as a path or an
http(s) URL. A relative path is resolved against the directory of each module, so prefixing it with ${maven.multiModuleProjectDirectory} has every module use the same file at the root of the repository.- Type:
java.lang.String - Required:
No - User Property:
rewrite.configLocation - Default:
${maven.multiModuleProjectDirectory}/rewrite.yml - Alias:
configLocation
<detail>
Whether to show the display name, description and options of each recipe.
- Type:
boolean - Required:
No - User Property:
detail - Default:
false
<exclusions>
Paths not to parse, as
PathMatcher glob patterns relative to the root of the repository, where ** matches any number of directories and * a single directory or file name. For example, docs/**.- Type:
java.util.LinkedHashSet<java.lang.String> - Required:
No - User Property:
rewrite.exclusions
<failOnInvalidActiveRecipes>
Whether to fail the build when an active recipe, or a recipe it includes, is not configured correctly. This may default to
true in the future.- Type:
boolean - Required:
No - User Property:
rewrite.failOnInvalidActiveRecipes - Default:
false - Alias:
failOnInvalidActiveRecipes
<plainTextMasks>
The files to parse as plain text, as glob patterns like those of
exclusions, replacing the default masks. The defaults cover common text files without a dedicated parser, such as Markdown, shell scripts and Dockerfiles. Exclusions take precedence over plain text masks, and additionalPlainTextMasks has no effect when this is set.- Type:
java.util.LinkedHashSet<java.lang.String> - Required:
No - User Property:
rewrite.plainTextMasks
<pomCacheDirectory>
The directory to create the
.rewrite-cache directory with cached POMs and Maven metadata in. Defaults to the user's home directory. Deleting the cache is safe, as it is populated again on the next run.- Type:
java.lang.String - Required:
No - User Property:
rewrite.pomCacheDirectory - Alias:
pomCacheDirectory
<pomCacheEnabled>
Whether to cache downloaded POMs and Maven metadata on disk, in
pomCacheDirectory. When disabled, an in-memory cache is used instead, which makes runs slower on projects with deep dependency trees.- Type:
boolean - Required:
No - User Property:
rewrite.pomCacheEnabled - Default:
true - Alias:
pomCacheEnabled
<recipe>
The name of a recipe to show, instead of every recipe. For example,
./mvnw rewrite:discover -Ddetail=true -Drecipe=org.openrewrite.java.format.AutoFormat.- Type:
java.lang.String - Required:
No - User Property:
recipe
<recipeArtifactCoordinates>
Recipe artifacts to add, as
groupId:artifactId:version coordinates, instead of or in addition to plugin dependencies. These are resolved from the repositories of the project rather than its plugin repositories.- Type:
java.util.LinkedHashSet<java.lang.String> - Required:
No - User Property:
rewrite.recipeArtifactCoordinates
<recursion>
How many levels of the recipes that a recipe includes to show.
- Type:
int - Required:
No - User Property:
recursion - Default:
0
<resolvePropertiesInYaml>
Whether to resolve Maven properties, like
${project.artifactId}, in the YAML configuration file.- Type:
boolean - Required:
No - User Property:
rewrite.resolvePropertiesInYaml - Default:
true
<rewriteSkip>
Whether to skip the execution of the plugin, to disable it without removing its configuration.
- Type:
boolean - Required:
No - User Property:
rewrite.skip - Default:
false
<runPerSubmodule>
Whether to run recipes on each module separately, rather than once on all the modules of the build.
- Type:
boolean - Required:
No - User Property:
rewrite.runPerSubmodule - Default:
false - Alias:
runPerSubmodule
<sizeThresholdMb>
The size in megabytes above which files other than Java sources are not parsed.
- Type:
int - Required:
No - User Property:
sizeThresholdMb - Default:
10
<skipMavenParsing>
Whether to skip parsing
pom.xml files, and the POMs they inherit from, as source files. This can make runs faster when no recipe changes POMs.- Type:
boolean - Required:
No - User Property:
skipMavenParsing - Default:
false
