Skip to main content

org.openrewrite

rewrite-cobol

License: Moderne Source Available License

7 recipes

rewrite-core

License: Apache License Version 2.0

29 recipes

  • org.openrewrite.AddToGitignore
    • Add entries to .gitignore
    • Adds entries to the project's .gitignore file. If no .gitignore file exists, one will be created. Existing entries that match will not be duplicated.
  • org.openrewrite.DeleteSourceFiles
    • Delete files
    • Delete files by source path.
  • org.openrewrite.ExcludeFileFromGitignore
    • Remove ignoral of files or directories from .gitignore
    • This recipe will remove a file or directory from the .gitignore file. If the file or directory is already in the .gitignore file, it will be removed or negated. If the file or directory is not in the .gitignore file, no action will be taken.
  • org.openrewrite.FindCollidingSourceFiles
    • Find colliding source files
    • Finds source files which share a path with another source file. There should always be exactly one source file per path within a repository. This is a diagnostic for finding problems in OpenRewrite parsers/build plugins.
  • org.openrewrite.FindDeserializationErrors
    • Find deserialization errors
    • Produces a data table collecting all deserialization errors of serialized LSTs.
  • org.openrewrite.FindGitProvenance
    • Show Git source control metadata
    • List out the contents of each unique GitProvenance marker in the set of source files. When everything is working correctly, exactly one such marker should be printed as all source files are expected to come from the same repository / branch / commit hash.
  • org.openrewrite.FindLstProvenance
    • Find LST provenance
    • Produces a data table showing what versions of OpenRewrite/Moderne tooling was used to produce a given LST.
  • org.openrewrite.FindParseFailures
    • Find source files with ParseExceptionResult markers
    • This recipe explores parse failures after an LST is produced for classifying the types of failures that can occur and prioritizing fixes according to the most common problems.
  • org.openrewrite.FindQuarks
    • Find instances of type Quark
    • Quark source files are pointers to the existence of a file without capturing any of the contents of the file.
  • org.openrewrite.FindSourceFiles
    • Find files
    • Find files by source path. Paths are always interpreted as relative to the repository root.
  • org.openrewrite.FindStyles
    • Find styles
    • Find and report the styles attached to each source file. Styles are output as valid OpenRewrite style YAML that can be used directly in rewrite.yml configuration.
  • org.openrewrite.IsInRepository
    • Is in repository
    • A search recipe which marks files that are in a repository with one of the supplied names. Intended for use as a precondition for other recipes being run over many different repositories.
  • org.openrewrite.ListRuntimeClasspath
    • List runtime classpath
    • A diagnostic utility which emits the runtime classpath to a data table.
  • org.openrewrite.MoveFile
    • Move a file
    • Move a file to a different directory. The file name will remain the same.
  • org.openrewrite.RenameFile
    • Rename a file
    • Rename a file while keeping it in the same directory.
  • org.openrewrite.SetFilePermissions
    • Set file permission attributes
    • Set a file's read, write and executable permission attributes.
  • org.openrewrite.Singleton
    • Singleton
    • Used as a precondition to ensure that a recipe attempts to make changes only once. Accidentally including multiple copies/instances of the same large composite recipes is a common mistake. If those recipes are marked with this precondition the performance penalty is limited. This recipe does nothing useful run on its own. ## Usage in YAML recipes Add org.openrewrite.Singleton as a precondition: yaml --- type: specs.openrewrite.org/v1beta/recipe name: com.example.Append displayName: My recipe preconditions: - org.openrewrite.Singleton recipeList: - org.openrewrite.text.AppendToTextFile: relativeFileName: report.txt content: 'Recipe executed' ## Usage in Java recipes Wrap visitors with Singleton.singleton(this, visitor) to ensure only the first equivalent recipe instance makes changes: java @Override public TreeVisitor<?, ExecutionContext> getVisitor(Accumulator acc) \{ return singleton(this, new TreeVisitor<Tree, ExecutionContext>() \{ @Override public Tree visit(@Nullable Tree tree, ExecutionContext ctx) \{ // Your transformation logic return tree; \} \}); \} @Override public Collection<SourceFile> generate(Accumulator acc, ExecutionContext ctx) \{ if (!isSingleton(this, ctx)) \{ return Collections.emptyList(); \} // Generate new sources return results; \} @Override public TreeVisitor<?, ExecutionContext> getVisitor(Accumulator acc) \{ return singleton(this, new TreeVisitor<Tree, ExecutionContext>() \{ // Visitor logic \}); \} Note: Singleton status is determined by the recipe's equals() and hashCode() methods. If equivalent instances of a recipe are not considered singletons, ensure your recipe class correctly implements these methods. The easiest way is to use Lombok's @Value annotation on your recipe class, which automatically generates correct equals() and hashCode() implementations based on all fields.
  • org.openrewrite.search.FindBuildMetadata
    • Find build metadata
    • Find source files with matching build metadata.
  • org.openrewrite.search.FindCommitters
    • Find committers on repositories
    • List the committers on a repository.
  • org.openrewrite.search.FindParseToPrintInequality
    • Find parse to print inequality
    • OpenRewrite Parser implementations should produce SourceFile objects whose printAll() method should be byte-for-byte equivalent with the original source file. When this isn't true, recipes can still run on the SourceFile and even produce diffs, but the diffs would fail to apply as a patch to the original source file. Most Parser use Parser#requirePrintEqualsInput to produce a ParseError when they fail to produce a SourceFile that is print idempotent.
  • org.openrewrite.search.RepositoryContainsFile
    • Repository contains file
    • Intended to be used primarily as a precondition for other recipes, this recipe checks if a repository contains a specific file or files matching a pattern. If present all files in the repository are marked with a SearchResult marker. If you want to get only the matching file as a search result, use FindSourceFiles instead.
  • org.openrewrite.text.AppendToTextFile
    • Append to text file
    • Appends or replaces content of an existing plain text file, or creates a new one if it doesn't already exist. Please note that this recipes requires existing plain text files' format to be successfully parsable by OpenRewrite. If a file is left unchanged, it might be parsed as a Quark rather than plain text. In such case, use the plainTextMask option. See the Gradle or Maven plugin configuration page.
  • org.openrewrite.text.ChangeText
    • Change text
    • Completely replaces the contents of the text file with other text. Use together with a FindSourceFiles precondition to limit which files are changed.
  • org.openrewrite.text.CreateTextFile
    • Create text file
    • Creates a new plain text file.
  • org.openrewrite.text.EndOfLineAtEndOfFile
    • End of Line @ End of File (EOL @ EOF)
    • Ensure that the file ends with the newline character. Note: If this recipe modifies a file, it converts the file into plain text. As such, this recipe should be run after any recipe that modifies the language-specific LST.
  • org.openrewrite.text.Find
    • Find text
    • Textual search, optionally using Regular Expression (regex) to query.
  • org.openrewrite.text.FindAndReplace
    • Find and replace
    • Textual find and replace, optionally interpreting the search query as a Regular Expression (regex). When operating on source files that are language-specific Lossless Semantic Tree, such as Java or XML, this operation converts the source file to plain text for the rest of the recipe run. So if you are combining this recipe with language-specific recipes in a single recipe run put all the language-specific recipes before this recipe.
  • org.openrewrite.text.FindMultiselect
    • Experimental find text with multiselect
    • Search for text, treating all textual sources as plain text. This version of the recipe exists to experiment with multiselect recipe options.
  • org.openrewrite.text.RemoveByteOrderMark
    • Remove byte order mark (BOM)
    • Removes UTF-8 byte order marks from the beginning of files. The BOM character (U+FEFF) is generally unnecessary in UTF-8 files and can cause issues with some tools.

rewrite-docker

License: Apache License Version 2.0

18 recipes

  • org.openrewrite.docker.AddAptGetCleanup
    • Add apt-get cleanup
    • Adds cleanup commands to apt-get RUN instructions to reduce Docker image size. By default, adds 'rm -rf /var/lib/apt/lists/*' to remove cached package lists.
  • org.openrewrite.docker.AddOciLabels
  • org.openrewrite.docker.AddOrUpdateLabel
    • Add Docker LABEL instruction
    • Adds or updates a LABEL instruction in a Dockerfile. By default, adds to the final stage only.
  • org.openrewrite.docker.AddUserInstruction
    • Add USER instruction
    • Adds a USER instruction to run the container as a non-root user (CIS Docker Benchmark 4.1). By default, adds to the final stage only and skips if a USER instruction already exists.
  • org.openrewrite.docker.ChangeFrom
    • Change Docker FROM
    • Change the base image in a Dockerfile FROM instruction. Each * in an old* glob is a positional capture; $N in the paired new* substitutes capture N. $0 substitutes the full original value; \$ is a literal dollar.
  • org.openrewrite.docker.CombineRunInstructions
    • Combine consecutive RUN instructions
    • Combines consecutive RUN instructions into a single instruction to reduce image layers. Only shell form RUN instructions without flags are combined.
  • org.openrewrite.docker.DockerBestPractices
    • Apply Docker best practices
    • Apply a set of Docker best practices to Dockerfiles. This recipe applies security hardening, build optimization, and maintainability improvements based on CIS Docker Benchmark and industry best practices.
  • org.openrewrite.docker.DockerBuildOptimization
    • Optimize Docker builds
    • Apply build optimization best practices to Dockerfiles. This includes combining RUN instructions to reduce layers and adding cleanup commands to reduce image size.
  • org.openrewrite.docker.DockerSecurityBestPractices
    • Apply Docker security best practices
    • Apply security-focused Docker best practices to Dockerfiles. This includes running as a non-root user (CIS 4.1) and using COPY instead of ADD where appropriate (CIS 4.9).
  • org.openrewrite.docker.NormalizeDockerHubImageName
    • Normalize Docker Hub image names
    • Normalizes Docker Hub image names to their canonical short form by removing redundant registry prefixes like docker.io/library/ or index.docker.io/.
  • org.openrewrite.docker.ReplaceAddWithCopy
    • Replace ADD with COPY
    • Replaces ADD instructions with COPY where appropriate. ADD is only kept when the source is a URL or a tar archive that should be auto-extracted. Using COPY is preferred for transparency (CIS Docker Benchmark 4.9).
  • org.openrewrite.docker.UseExecFormEntrypoint
    • Use exec form for ENTRYPOINT and CMD
    • Converts shell form ENTRYPOINT and CMD instructions to exec form (JSON array). Exec form is preferred because it runs the command as PID 1, allowing it to receive Unix signals properly. Shell form wraps commands in /bin/sh -c which can cause signal handling issues.
  • org.openrewrite.docker.search.FindBaseImages
    • Find Docker base images
    • Find all base images (FROM instructions) in Dockerfiles.
  • org.openrewrite.docker.search.FindEndOfLifeImages
    • Find end-of-life Docker base images
    • Identifies Docker base images that have reached end-of-life. Using EOL images poses security risks as they no longer receive security updates. Detected images include EOL versions of Debian, Ubuntu, Alpine, Python, and Node.js.
  • org.openrewrite.docker.search.FindExposedPorts
    • Find exposed ports
    • Find all EXPOSE instructions in Dockerfiles and report the exposed ports.
  • org.openrewrite.docker.search.FindMissingHealthcheck
    • Find missing HEALTHCHECK
    • Finds Dockerfiles where the final stage is missing a HEALTHCHECK instruction (CIS Docker Benchmark 4.6). Health checks help container orchestrators determine if a container is healthy and ready to receive traffic.
  • org.openrewrite.docker.search.FindRootUser
    • Find containers running as root
    • Finds containers that run as root user (CIS Docker Benchmark 4.1). This includes explicit USER root or USER 0 instructions, and optionally containers with no USER instruction in the final stage (which default to root).
  • org.openrewrite.docker.search.FindUnpinnedBaseImages
    • Find unpinned base images
    • Finds FROM instructions that use unpinned base images (CIS Docker Benchmark 4.2). Images without an explicit tag default to 'latest', which is not reproducible. Images pinned by digest are considered acceptable.

rewrite-gradle

License: Apache License Version 2.0

73 recipes

rewrite-groovy

License: Apache License Version 2.0

4 recipes

rewrite-hcl

License: Apache License Version 2.0

11 recipes

rewrite-java

License: Apache License Version 2.0

101 recipes

rewrite-javascript

License: Moderne Source Available License

17 recipes

rewrite-json

License: Apache License Version 2.0

10 recipes

rewrite-kotlin

License: Apache License Version 2.0

11 recipes

  • org.openrewrite.kotlin.FindKotlinSources
    • Find Kotlin sources and collect data metrics
    • Use data table to collect source files types and counts of files with extensions .kt.
  • org.openrewrite.kotlin.OrderImports
    • Order Kotlin imports
    • Groups and orders import statements. If a style has been defined, this recipe will order the imports according to that style. If no style is detected, this recipe will default to ordering imports in the same way that IntelliJ IDEA does.
  • org.openrewrite.kotlin.RenameTypeAlias
    • Rename type alias
    • Change the name of a given type alias.
  • org.openrewrite.kotlin.cleanup.EqualsMethodUsage
    • Structural equality tests should use == or !=
    • In Kotlin, == means structural equality and != structural inequality and both map to the left-side term’s equals() function. It is, therefore, redundant to call equals() as a function. Also, == and != are more general than equals() and !equals() because it allows either of both operands to be null. Developers using equals() instead of == or != is often the result of adapting styles from other languages like Java, where == means reference equality and != means reference inequality. The == and != operators are a more concise and elegant way to test structural equality than calling a function.
  • org.openrewrite.kotlin.cleanup.ImplicitParameterInLambda
    • it shouldn't be used as a lambda parameter name
    • it is a special identifier that allows you to refer to the current parameter being passed to a lambda expression without explicitly naming the parameter. Lambda expressions are a concise way of writing anonymous functions. Many lambda expressions have only one parameter, when this is true the compiler can determine the parameter type by context. Thus when using it with single parameter lambda expressions, you do not need to declare the type.
  • org.openrewrite.kotlin.cleanup.RemoveLambdaArgumentParentheses
    • Remove method invocation parentheses around single lambda argument
    • For example, convert 1.let(\{ it + 1 \}) to 1.let \{ it + 1 \}.
  • org.openrewrite.kotlin.cleanup.RemoveTrailingComma
    • Remove trailing comma in Kotlin
    • Remove trailing commas in variable, parameter, and class property lists.
  • org.openrewrite.kotlin.cleanup.RemoveTrailingSemicolon
    • Remove unnecessary trailing semicolon
    • Some Java programmers may mistakenly add semicolons at the end when writing Kotlin code, but in reality, they are not necessary.
  • org.openrewrite.kotlin.cleanup.ReplaceCharToIntWithCode
    • Replace Char#toInt() with Char#code
    • Replace the usage of the deprecated Char#toInt() with Char#code. Please ensure that your Kotlin version is 1.5 or later to support the Char#code property. Note that the current implementation does not perform a Kotlin version check.
  • org.openrewrite.kotlin.cleanup.UnnecessaryTypeParentheses
    • Remove unnecessary parentheses on Kotlin types
    • In Kotlin, it's possible to add redundant nested parentheses in type definitions. This recipe is designed to remove those unnecessary parentheses.
  • org.openrewrite.kotlin.format.AutoFormat
    • Format Kotlin code
    • Format Kotlin code using a standard comprehensive set of Kotlin formatting recipes.

rewrite-maven

License: Apache License Version 2.0

90 recipes

  • org.openrewrite.maven.AddAnnotationProcessor
    • Add an annotation processor to maven-compiler-plugin
    • Add an annotation processor path to the maven-compiler-plugin configuration. For modules with an in-reactor parent, adds to the parent's build/pluginManagement/plugins section. For modules without a parent or with a parent outside the reactor, adds directly to build/plugins. Updates the annotation processor version if a newer version is specified.
  • org.openrewrite.maven.AddCommentToMavenDependency
    • Add a comment to a Maven dependency or plugin
    • Adds a comment as the first element in a Maven dependency or plugin.
  • org.openrewrite.maven.AddDependency
    • Add Maven dependency
    • Add a Maven dependency to a pom.xml file in the correct scope based on where it is used.
  • org.openrewrite.maven.AddDevelocityMavenExtension
    • Add the Develocity Maven extension
    • To integrate the Develocity Maven extension into Maven projects, ensure that the develocity-maven-extension is added to the .mvn/extensions.xml file if not already present. Additionally, configure the extension by adding the .mvn/develocity.xml configuration file.
  • org.openrewrite.maven.AddManagedDependency
    • Add managed Maven dependency
    • Add a managed Maven dependency to a pom.xml file.
  • org.openrewrite.maven.AddManagedPlugin
    • Add Managed Maven plugin
    • Add the specified Maven plugin to the Plugin Managed of the pom.xml.
  • org.openrewrite.maven.AddParentPom
    • Add Maven parent
    • Add a parent pom to a Maven pom.xml. Does nothing if a parent pom is already present.
  • org.openrewrite.maven.AddPlugin
    • Add Maven plugin
    • Add the specified Maven plugin to the pom.xml.
  • org.openrewrite.maven.AddPluginDependency
    • Add Maven plugin dependencies
    • Adds the specified dependencies to a Maven plugin. Will not add the plugin if it does not already exist in the pom.
  • org.openrewrite.maven.AddProfile
    • Add Maven profile
    • Add a maven profile to a pom.xml file.
  • org.openrewrite.maven.AddProperty
    • Add Maven project property
    • Add a new property to the Maven project property. Prefers to add the property to the parent if the project has multiple modules.
  • org.openrewrite.maven.AddRepository
    • Add repository
    • Adds a new Maven Repository or updates a matching repository.
  • org.openrewrite.maven.AddRuntimeConfig
    • Add a configuration option for the Maven runtime
    • Add a new configuration option for the Maven runtime if not already present.
  • org.openrewrite.maven.BestPractices
    • Apache Maven best practices
    • Applies best practices to Maven POMs.
  • org.openrewrite.maven.ChangeDependencyClassifier
    • Change Maven dependency classifier
    • Add or alter the classifier of the specified dependency.
  • org.openrewrite.maven.ChangeDependencyGroupIdAndArtifactId
    • Change Maven dependency
    • Change a Maven dependency coordinates. The newGroupId or newArtifactId MUST be different from before. Matching <dependencyManagement> coordinates are also updated if a newVersion or versionPattern is provided. Exclusions that reference the old dependency coordinates are preserved, and a sibling exclusion for the new coordinates is added alongside them.
  • org.openrewrite.maven.ChangeDependencyScope
    • Change Maven dependency scope
    • Add or alter the scope of the specified dependency.
  • org.openrewrite.maven.ChangeExclusion
    • Change Maven dependency exclusion
    • Modify Maven dependency exclusions, changing the group ID, artifact Id, or both. Useful when an excluded dependency has been renamed and references to it must be updated.
  • org.openrewrite.maven.ChangeManagedDependencyGroupIdAndArtifactId
    • Change Maven managed dependency groupId, artifactId and optionally the version
    • Change the groupId, artifactId and optionally the version of a specified Maven managed dependency.
  • org.openrewrite.maven.ChangePackaging
    • Set Maven project packaging
    • Sets the packaging type of Maven projects. Either adds the packaging tag if it is missing or changes its context if present.
  • org.openrewrite.maven.ChangeParentPom
    • Change Maven parent
    • Change the parent pom of a Maven pom.xml by matching the existing parent via groupId and artifactId, and updating it to a new groupId, artifactId, version, and optional relativePath. Also updates the project to retain dependency management and properties previously inherited from the old parent that are no longer provided by the new parent. Removes redundant dependency versions already managed by the new parent.
  • org.openrewrite.maven.ChangePluginConfiguration
    • Change Maven plugin configuration
    • Apply the specified configuration to a Maven plugin. Will not add the plugin if it does not already exist in the pom.
  • org.openrewrite.maven.ChangePluginDependencies
    • Change Maven plugin dependencies
    • Applies the specified dependencies to a Maven plugin. Will not add the plugin if it does not already exist in the pom.
  • org.openrewrite.maven.ChangePluginExecutions
    • Change Maven plugin executions
    • Apply the specified executions to a Maven plugin. Will not add the plugin if it does not already exist in the pom.
  • org.openrewrite.maven.ChangePluginGroupIdAndArtifactId
    • Change Maven plugin group and artifact ID
    • Change the groupId and/or the artifactId of a specified Maven plugin. Optionally update the plugin version. This recipe does not perform any validation and assumes all values passed are valid.
  • org.openrewrite.maven.ChangeProjectVersion
    • Change Maven Project Version
    • Change the project version of a Maven pom.xml. Identifies the project to be changed by its groupId and artifactId. If the version is defined as a property, this recipe will only change the property value if the property exists within the same pom.
  • org.openrewrite.maven.ChangePropertyValue
    • Change Maven project property value
    • Changes the specified Maven project property value leaving the key intact.
  • org.openrewrite.maven.EnableDevelocityBuildCache
    • Enable Develocity build cache
    • Add Develocity build cache configuration to any .mvn/ Develocity configuration file that lack existing configuration.
  • org.openrewrite.maven.ExcludeDependency
    • Exclude Maven dependency
    • Exclude specified dependency from any dependency that transitively includes it.
  • org.openrewrite.maven.IncrementProjectVersion
    • Increment Maven project version
    • Increase Maven project version by incrementing either the major, minor, or patch version as defined by semver. Other versioning schemes are not supported.
  • org.openrewrite.maven.ManageDependencies
    • Manage dependencies
    • Make existing dependencies managed by moving their version to be specified in the dependencyManagement section of the POM.
  • org.openrewrite.maven.ManagedToRuntimeDependencies
    • Convert managed dependencies to runtime dependencies
    • This recipe processes Maven POMs, converting all <dependencyManagement> entries into runtime scoped <dependencies> entries. Import scoped BOMs (like jackson-bom) are left unmodified in <dependencyManagement>. Some style guidelines prefer that <dependencyManagement> be used only for BOMs. This maintain that style while avoiding introducing new symbols onto the compile classpath unintentionally.
  • org.openrewrite.maven.MigrateToMaven4
    • Migrate to Maven 4
    • Migrates Maven POMs from Maven 3 to Maven 4, addressing breaking changes and deprecations. This recipe updates property expressions, lifecycle phases, removes duplicate plugin declarations, and replaces removed properties to ensure compatibility with Maven 4.
  • org.openrewrite.maven.ModernizeObsoletePoms
    • Modernize obsolete Maven poms
    • Very old Maven poms are no longer supported by current versions of Maven. This recipe updates poms with <pomVersion>3</pomVersion> to <modelVersion>4.0.0</modelVersion> of the Maven pom schema. This does not attempt to upgrade old dependencies or plugins and is best regarded as the starting point of a migration rather than an end-point.
  • org.openrewrite.maven.OrderPomElements
    • Order POM elements
    • Order POM elements according to the recommended order.
  • org.openrewrite.maven.RemoveDependency
    • Remove Maven dependency
    • Removes a single dependency from the <dependencies> section of the pom.xml. Does not remove usage of the dependency classes, nor guard against the resulting compilation errors.
  • org.openrewrite.maven.RemoveDuplicateDependencies
    • Remove duplicate Maven dependencies
    • Removes duplicated dependencies in the &lt;dependencies&gt; and &lt;dependencyManagement&gt; sections of the pom.xml.
  • org.openrewrite.maven.RemoveDuplicatePluginDeclarations
    • Remove duplicate plugin declarations
    • Maven 4 rejects duplicate plugin declarations (same groupId and artifactId) with an error. This recipe removes duplicate plugin declarations, keeping only the first occurrence.
  • org.openrewrite.maven.RemoveExclusion
    • Remove exclusion
    • Remove any matching exclusion from any matching dependency.
  • org.openrewrite.maven.RemoveManagedDependency
    • Remove Maven managed dependency
    • Removes a single managed dependency from the <dependencyManagement><dependencies> section of the pom.xml.
  • org.openrewrite.maven.RemoveMavenWrapper
    • Remove Maven wrapper
    • Remove Maven wrapper files from a project. This includes the mvnw and mvnw.cmd scripts, and the .mvn/wrapper directory.
  • org.openrewrite.maven.RemovePlugin
    • Remove Maven plugin
    • Remove the specified Maven plugin from the POM.
  • org.openrewrite.maven.RemovePluginDependency
    • Remove Maven plugin dependency
    • Removes a dependency from the <dependencies> section of a plugin in the pom.xml.
  • org.openrewrite.maven.RemoveProperty
    • Remove Maven project property
    • Removes the specified Maven project property from the pom.xml.
  • org.openrewrite.maven.RemoveRedundantDependencyVersions
    • Remove redundant explicit dependency and plugin versions
    • Remove explicitly-specified dependency/plugin versions when a parent POM's dependencyManagement/pluginManagement specifies the version.
  • org.openrewrite.maven.RemoveRedundantProperties
    • Remove redundant properties
    • Remove properties when a parent POM specifies the same property.
  • org.openrewrite.maven.RemoveRepository
    • Remove repository
    • Removes a matching Maven repository.
  • org.openrewrite.maven.RemoveUnusedProperties
    • Remove unused properties
    • Detect and remove Maven property declarations which do not have any usage within the project.
  • org.openrewrite.maven.RenamePropertyKey
    • Rename Maven property key
    • Rename the specified Maven project property key leaving the value unchanged.
  • org.openrewrite.maven.ReplaceDeprecatedLifecyclePhases
    • Replace deprecated lifecycle phases
    • Maven 4 deprecated all pre-* and post-* lifecycle phases in favor of the before: and after: syntax. This recipe updates plugin phase declarations to use the new syntax, including pre-cleanbefore:clean, pre-sitebefore:site, pre-integration-testbefore:integration-test, and their post-* equivalents.
  • org.openrewrite.maven.ReplaceModulesWithSubprojects
    • Replace modules with subprojects
    • Maven 4 model version 4.1.0 deprecates the &lt;modules&gt; element in favor of &lt;subprojects&gt; to eliminate confusion with Java's Platform Module System (JPMS). This recipe renames &lt;modules&gt; to &lt;subprojects&gt; and &lt;module&gt; children to &lt;subproject&gt;.
  • org.openrewrite.maven.ReplaceRemovedRootDirectoryProperties
    • Replace removed root directory properties
    • Maven 4 removed support for deprecated root directory properties. This recipe replaces $\{executionRootDirectory\} with $\{session.rootDirectory\} and $\{multiModuleProjectDirectory\} with $\{project.rootDirectory\}.
  • org.openrewrite.maven.ReproducibleBuilds
    • Apache Maven reproducible builds
    • Configure a Maven project for reproducible builds: pin dependency and plugin versions, set project.build.outputTimestamp, set explicit UTF-8 source encoding, and upgrade core plugins to versions that honor the output timestamp.
  • org.openrewrite.maven.SortDependencies
    • Sort dependencies
    • Sort dependencies alphabetically by groupId then artifactId. Test-scoped dependencies are sorted after non-test dependencies. Applies to both &lt;dependencies&gt; and &lt;dependencyManagement&gt; sections.
  • org.openrewrite.maven.UpdateMavenProjectPropertyJavaVersion
    • Update Maven Java project properties
    • The Java version is determined by several project properties, including: * java.version * jdk.version * javaVersion * jdkVersion * maven.compiler.source * maven.compiler.target * maven.compiler.release * release.version If none of these properties are in use and the maven compiler plugin is not otherwise configured, adds the maven.compiler.release property.
  • org.openrewrite.maven.UpdateMavenWrapper
    • Update Maven wrapper
    • Update the version of Maven used in an existing Maven wrapper.
  • org.openrewrite.maven.UpdateScmFromGitOrigin
    • Update SCM with Git origin
    • Updates or adds the Maven &lt;scm&gt; tag based on the Git remote origin. By default, only existing Source Control Management (SCM) sections are updated. Set addIfMissing to true to also add missing SCM sections to root POMs (POMs without a parent element).
  • org.openrewrite.maven.UpgradeDependencyVersion
    • Upgrade Maven dependency version
    • Upgrade the version of a dependency by specifying a group and (optionally) an artifact using Node Semver advanced range selectors, allowing more precise control over version updates to patch or minor releases.
  • org.openrewrite.maven.UpgradeParentVersion
    • Upgrade Maven parent project version
    • Set the parent pom version number according to a version selector or to a specific version number.
  • org.openrewrite.maven.UpgradePluginVersion
    • Upgrade Maven plugin version
    • Upgrade the version of a plugin using Node Semver advanced range selectors, allowing more precise control over version updates to patch or minor releases.
  • org.openrewrite.maven.UpgradeToModelVersion410
    • Upgrade to Maven model version 4.1.0
    • Upgrades Maven POMs from model version 4.0.0 to 4.1.0, enabling new Maven 4 features like &lt;subprojects&gt;, bom packaging, and automatic version inference. This recipe updates the &lt;modelVersion&gt; element, xmlns namespace, and xsi:schemaLocation from 4.0.0 to 4.1.0.
  • org.openrewrite.maven.UpgradeTransitiveDependencyVersion
    • Upgrade transitive Maven dependencies
    • Upgrades the version of a transitive dependency in a Maven pom file. Leaves direct dependencies unmodified. Can be paired with the regular Upgrade Dependency Version recipe to upgrade a dependency everywhere, regardless of whether it is direct or transitive.
  • org.openrewrite.maven.UseMavenCompilerPluginReleaseConfiguration
    • Use Maven compiler plugin release configuration
    • Replaces any explicit source or target configuration (if present) on the maven-compiler-plugin with release, and updates the release value if needed. When testSource or testTarget differ from the main version, introduces testRelease. Will not downgrade the Java version if the current version is higher. Also removes stale maven.compiler.source, maven.compiler.target, maven.compiler.testSource, and maven.compiler.testTarget properties that are no longer referenced.
  • org.openrewrite.maven.UseParentInference
    • Use Maven 4 parent inference
    • Maven 4.1.0 supports automatic parent version inference when using a relative path. This recipe simplifies parent declarations by using the shorthand &lt;parent/&gt; form when the parent is in the default location (..), removing the explicit &lt;relativePath&gt;, &lt;groupId&gt;, &lt;artifactId&gt;, and &lt;version&gt; elements. Maven automatically infers these values from the parent POM.
  • org.openrewrite.maven.cleanup.AddProjectBuildOutputTimestamp
    • Add project.build.outputTimestamp for reproducible builds
    • Adds the project.build.outputTimestamp property, which Maven uses to make build outputs reproducible by stamping archive entries with a fixed timestamp instead of the current time. An existing value is preserved. See Configuring for Reproducible Builds.
  • org.openrewrite.maven.cleanup.DependencyManagementDependencyRequiresVersion
    • Dependency management dependencies should have a version
    • If they don't have a version, they can't possibly affect dependency resolution anywhere, and can be safely removed.
  • org.openrewrite.maven.cleanup.ExplicitDependencyVersion
    • Add explicit dependency versions
    • Add explicit dependency versions to POMs for reproducibility, as the LATEST and RELEASE version keywords are deprecated.
  • org.openrewrite.maven.cleanup.ExplicitPluginGroupId
    • Add explicit groupId to Maven plugins
    • Add the default &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; to plugins for clarity.
  • org.openrewrite.maven.cleanup.ExplicitPluginVersion
    • Add explicit plugin versions
    • Add explicit plugin versions to POMs for reproducibility, as MNG-4173 removes automatic version resolution for POM plugins.
  • org.openrewrite.maven.cleanup.NoSystemScopeDependencies
    • Dependencies should not have system scope
    • Replaces &lt;scope&gt;system&lt;/scope&gt; with the default compile scope and removes &lt;systemPath&gt; for dependencies that are available in configured repositories.
  • org.openrewrite.maven.cleanup.PrefixlessExpressions
    • Drop prefixless expressions in POM
    • MNG-7404 drops support for prefixless in POMs. This recipe will add the project. prefix where missing.
  • org.openrewrite.maven.plugin.DependencyPluginGoalResolveSources
    • Migrate to maven-dependency-plugin goal resolve-sources
    • Migrate from sources to resolve-sources for the maven-dependency-plugin.
  • org.openrewrite.maven.search.DependencyInsight
    • Maven dependency insight
    • Find direct and transitive dependencies matching a group, artifact, and scope. Results include dependencies that either directly match or transitively include a matching dependency.
  • org.openrewrite.maven.search.DoesNotIncludeDependency
    • Does not include Maven dependency
    • A precondition which returns false if visiting a Maven pom which includes the specified dependency in the classpath of some scope. For compatibility with multimodule projects, this should most often be applied as a precondition.
  • org.openrewrite.maven.search.EffectiveDependencies
    • Effective dependencies
    • Emit the data of binary dependency relationships.
  • org.openrewrite.maven.search.EffectiveManagedDependencies
    • Effective managed dependencies
    • Emit the data of binary dependency relationships.
  • org.openrewrite.maven.search.EffectiveMavenRepositories
    • List effective Maven repositories
    • Lists the Maven repositories that would be used for dependency resolution, in order of precedence. This includes Maven repositories defined in the Maven settings file (and those contributed by active profiles) as determined when the LST was produced.
  • org.openrewrite.maven.search.FindDependency
    • Find Maven dependency
    • Finds first-order dependency uses, i.e. dependencies that are defined directly in a project. Each match is also recorded as a row in the DependenciesDeclared data table.
  • org.openrewrite.maven.search.FindManagedDependency
    • Find Maven dependency management entry
    • Finds first-order dependency management entries, i.e. dependencies that are defined directly in a project.
  • org.openrewrite.maven.search.FindMavenProject
    • Find Maven projects
    • Maven projects are pom.xml files with a MavenResolutionResult marker.
  • org.openrewrite.maven.search.FindMavenSettings
    • Find effective maven settings
    • List the effective maven settings file for the current project.
  • org.openrewrite.maven.search.FindPlugin
    • Find Maven plugin
    • Finds a Maven plugin within a pom.xml.
  • org.openrewrite.maven.search.FindProperties
    • Find Maven project properties
    • Finds the specified Maven project properties within a pom.xml.
  • org.openrewrite.maven.search.FindRepositoryOrder
    • Maven repository order
    • Determine the order in which dependencies will be resolved for each pom.xml based on its defined repositories and effective settings.xml.
  • org.openrewrite.maven.search.FindScm
    • Find SCM tag
    • Finds any &lt;scm&gt; tag directly inside the &lt;project&gt; root of a Maven pom.xml file.
  • org.openrewrite.maven.search.ModuleHasDependency
    • Module has dependency
    • Searches for Maven modules that have a dependency matching the specified groupId and artifactId. Places a SearchResult marker on all sources within a module with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that use spring-boot-starter, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file applying the plugin, use the FindDependency recipe instead.
  • org.openrewrite.maven.search.ModuleHasPlugin
    • Module has plugin
    • Searches for Maven modules that have a plugin matching the specified groupId and artifactId. Places a SearchResult marker on all sources within a module with a matching plugin. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that apply the spring boot plugin, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file applying the plugin, use the FindPlugins recipe instead.
  • org.openrewrite.maven.search.ParentPomInsight
    • Maven parent insight
    • Find Maven parents matching a groupId and artifactId.
  • org.openrewrite.maven.security.UseHttpsForRepositories
    • Use HTTPS for repositories
    • Use HTTPS for repository URLs.
  • org.openrewrite.maven.utilities.PrintMavenAsDot
    • Print Maven dependency hierarchy in DOT format
    • The DOT language format is specified here.

rewrite-properties

License: Apache License Version 2.0

8 recipes

rewrite-python

License: Moderne Proprietary License

15 recipes

  • org.openrewrite.python.AddDependency
    • Add Python dependency
    • Add a dependency to a Python project. Supports pyproject.toml (with scope/group targeting), requirements.txt, and Pipfile. When the matching package manager (uv or pipenv) is available, the corresponding lock file (uv.lock or Pipfile.lock) is regenerated. Not safe to use as a precondition: invokes the package manager and publishes per-project state shared with other dependency recipes.
  • org.openrewrite.python.AddLiteralMethodArgument
    • Add literal method argument
    • Add a literal argument to method invocations matching a pattern.
  • org.openrewrite.python.ChangeDependency
    • Change Python dependency
    • Change a dependency to a different package. Supports pyproject.toml, requirements.txt, and Pipfile. Searches all dependency scopes. When the matching package manager (uv or pipenv) is available, the corresponding lock file (uv.lock or Pipfile.lock) is regenerated. Not safe to use as a precondition: invokes the package manager and publishes per-project state shared with other dependency recipes.
  • org.openrewrite.python.ChangeImport
    • Change import
    • Change a Python import from one module/name to another, updating all type attributions.
  • org.openrewrite.python.ChangeMethodName
    • Change method name
    • Rename method invocations matching a pattern.
  • org.openrewrite.python.ChangePackage
    • Change package
    • Change package/module references from one name to another.
  • org.openrewrite.python.ChangeType
    • Change type
    • Change a type reference from one fully qualified name to another.
  • org.openrewrite.python.DeleteMethodArgument
    • Delete method argument
    • Remove an argument from method invocations matching a pattern.
  • org.openrewrite.python.RemoveDependency
    • Remove Python dependency
    • Remove a dependency from a Python project. Supports pyproject.toml (with scope/group targeting), requirements.txt, and Pipfile. When the matching package manager (uv or pipenv) is available, the corresponding lock file (uv.lock or Pipfile.lock) is regenerated. Not safe to use as a precondition: invokes the package manager and publishes per-project state shared with other dependency recipes.
  • org.openrewrite.python.RemovePass
    • Remove redundant pass statements
    • Remove redundant pass statements from Python code when there are other executable statements in the block.
  • org.openrewrite.python.ReorderMethodArguments
    • Reorder method arguments
    • Reorder arguments in method invocations matching a pattern.
  • org.openrewrite.python.UpgradeDependencyVersion
    • Upgrade Python dependency version
    • Upgrade the version constraint for a dependency. Supports pyproject.toml (with scope/group targeting), requirements.txt, and Pipfile. When the matching package manager (uv or pipenv) is available, the corresponding lock file (uv.lock or Pipfile.lock) is regenerated. Not safe to use as a precondition: invokes the package manager and publishes per-project state shared with other dependency recipes.
  • org.openrewrite.python.UpgradeTransitiveDependencyVersion
    • Upgrade transitive Python dependency version
    • Pin a transitive dependency version using the strategy appropriate for the file type and package manager. For pyproject.toml: uv uses [tool.uv].constraint-dependencies, PDM uses [tool.pdm.overrides], and other managers add a direct dependency. For requirements.txt and Pipfile: appends the dependency. Not safe to use as a precondition: invokes the package manager and publishes per-project state shared with other dependency recipes.
  • org.openrewrite.python.format.PythonSpaces
    • Formats spaces in Python code
    • Standardizes spaces in Python code. Currently limited to formatting method arguments.
  • org.openrewrite.python.search.DependencyInsight
    • Python dependency insight
    • Find direct and transitive Python dependencies matching a package name pattern. Results include dependencies that either directly match or transitively include a matching dependency.

rewrite-toml

License: Apache License Version 2.0

10 recipes

rewrite-xml

License: Apache License Version 2.0

28 recipes

rewrite-yaml

License: Apache License Version 2.0

18 recipes