Scanning Recipes
This doc contains all scanning recipes.
io.moderne.recipe:rewrite-devcenter
- io.moderne.devcenter.FindOrganizationStatistics
- Find organization statistics
- Counts lines of code per repository for organization-level statistics.
org.openrewrite.meta:rewrite-analysis
- org.openrewrite.analysis.search.FindFlowBetweenMethods
- Finds flow between two methods
- Takes two patterns for the start/end methods to find flow between.
org.openrewrite.recipe:rewrite-all
- org.openrewrite.FindDuplicateSourceFiles
- Find duplicate source files
- Record the presence of LSTs with duplicate paths, indicating that the same file was parsed more than once.
- org.openrewrite.LanguageComposition
- Language composition report
- Counts the number of lines of the various kinds of source code and data formats parsed by OpenRewrite. Comments are not included in line counts. This recipe emits its results as two data tables, making no changes to any source file. One data table is per-file, the other is per-repository.
org.openrewrite.recipe:rewrite-codemods
- org.openrewrite.codemods.ApplyCodemod
- Applies a codemod to all source files
- Applies a codemod represented by an NPM package to all source files.
- org.openrewrite.codemods.Biome
- Biome recommendations
- Run Biome recommended settings on your projects.
- org.openrewrite.codemods.ESLint
- Lint source code with ESLint
- Run ESLint across the code to fix common static analysis issues in the code. This requires the code to have an existing ESLint configuration.
- org.openrewrite.codemods.Putout
- Run Putout
- Run Putout on your projects.
- org.openrewrite.codemods.ReactI18Next
- React i18next internationalization
- Automatically internationalizes React applications by extracting hardcoded strings and replacing them with react-i18next translation calls. Handles JSX text, attributes, and template literals with variables. Creates and updates a translation JSON file with extracted strings.
- org.openrewrite.codemods.UI5
- Lint UI5 projects with UI5 linter
- Runs the UI5 Linter, a static code analysis tool for UI5 projects. It checks JavaScript, TypeScript, XML, JSON, and other files in your project and reports findings.
org.openrewrite.recipe:rewrite-java-dependencies
- org.openrewrite.java.dependencies.AddDependency
- Add Gradle or Maven dependency
- For a Gradle project, add a gradle dependency to a
build.gradlefile in the correct configuration based on where it is used. Or For a maven project, Add a Maven dependency to apom.xmlfile in the correct scope based on where it is used.
- org.openrewrite.java.dependencies.DependencyResolutionDiagnostic
- Dependency resolution diagnostic
- Recipes which manipulate dependencies must be able to successfully access the artifact repositories and resolve dependencies from them. This recipe produces two data tables used to understand the state of dependency resolution. The Repository accessibility report lists all the artifact repositories known to the project and whether respond to network access. The network access is attempted while the recipe is run and so is representative of current conditions. The Gradle dependency configuration errors lists all the dependency configurations that failed to resolve one or more dependencies when the project was parsed. This is representative of conditions at the time the LST was parsed.
- org.openrewrite.java.dependencies.RelocatedDependencyCheck
- Find relocated dependencies
- Find Maven and Gradle dependencies and Maven plugins that have relocated to a new
groupIdorartifactId. Relocation information comes from the oga-maven-plugin maintained by Jonathan Lermitage, Filipe Roque and others. This recipe makes no changes to any source file by default. AddchangeDependencies=trueto change dependencies, but note that you might need to run additional recipes to update imports and adopt other breaking changes.
- org.openrewrite.java.dependencies.RemoveDependency
- Remove a Gradle or Maven dependency
- For Gradle project, removes a single dependency from the dependencies section of the
build.gradle. For Maven project, removes a single dependency from the<dependencies>section of the pom.xml.
- org.openrewrite.java.dependencies.RemoveRedundantDependencies
- Remove redundant explicit dependencies
- Remove explicit dependencies that are already provided transitively by a specified dependency. This recipe downloads and resolves the parent dependency's POM to determine its true transitive dependencies, allowing it to detect redundancies even when both dependencies are explicitly declared.
- org.openrewrite.java.dependencies.UpgradeDependencyVersion
- Upgrade Gradle or Maven dependency versions
- For Gradle projects, upgrade the version of a dependency in a
build.gradlefile. Supports updating dependency declarations of various forms: *Stringnotation:"group:artifact:version"*Mapnotation:group: 'group', name: 'artifact', version: 'version'It is possible to update version numbers which are defined earlier in the same file in variable declarations. For Maven projects, upgrade the version of a dependency by specifying a group ID and (optionally) an artifact ID using Node Semver advanced range selectors, allowing more precise control over version updates to patch or minor releases.
- org.openrewrite.java.dependencies.UpgradeTransitiveDependencyVersion
- Upgrade transitive Gradle or Maven dependencies
- Upgrades the version of a transitive dependency in a Maven pom.xml or Gradle build.gradle. 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.java.dependencies.search.FindDuplicateClasses
- Find duplicate classes on the classpath
- Detects classes that appear in multiple dependencies on the classpath. This is similar to what the Maven duplicate-finder-maven-plugin does. Duplicate classes can cause runtime issues when different versions of the same class are loaded.
- org.openrewrite.java.dependencies.search.FindMinimumDependencyVersion
- Find the oldest matching dependency version in use
- The oldest dependency version in use is the lowest dependency version in use in any source set of any subproject of a repository. It is possible that, for example, the main source set of a project uses Jackson 2.11, but a test source set uses Jackson 2.16. In this case, the oldest Jackson version in use is Java 2.11.
- org.openrewrite.java.dependencies.search.FindMinimumJUnitVersion
- Find minimum JUnit version
- A recipe to find the minimum version of JUnit dependencies. This recipe is designed to return the minimum version of JUnit in a project. It will search for JUnit 4 and JUnit 5 dependencies in the project. If both versions are found, it will return the minimum version of JUnit 4. If a minimumVersion is provided, the recipe will search to see if the minimum version of JUnit used by the project is no lower than the minimumVersion. For example: if the minimumVersion is 4, and the project has JUnit 4.12 and JUnit 5.7, the recipe will return JUnit 4.12. If the project has only JUnit 5.7, the recipe will return JUnit 5.7. Another example: if the minimumVersion is 5, and the project has JUnit 4.12 and JUnit 5.7, the recipe will not return any results.
- org.openrewrite.java.dependencies.search.ModuleHasDependency
- Module has dependency
- Searches for both Gradle and Maven modules that have a dependency matching the specified groupId and artifactId. Places a
SearchResultmarker 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) or pom.xml file applying the plugin, use theFindDependencyrecipe instead.
- org.openrewrite.java.dependencies.search.RepositoryHasDependency
- Repository has dependency
- Searches for both Gradle and Maven modules that have a dependency matching the specified groupId and artifactId. Places a
SearchResultmarker on all sources within a repository 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 a springframework dependency, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) or pom.xml file applying the plugin, use theFindDependencyrecipe instead.
org.openrewrite.recipe:rewrite-jenkins
- org.openrewrite.jenkins.CreateIndexJelly
- Create
index.jellyif it doesn't exist - Jenkins tooling requires
src/main/resources/index.jellyexists with a description.
- Create
- org.openrewrite.jenkins.UpgradeJavaVersion
- Upgrade jenkins java version
- Upgrades the version of java specified in Jenkins groovy scripts. Will not downgrade if the version is newer than the specified version.
- org.openrewrite.jenkins.github.AddTeamToCodeowners
- Add plugin developer team to CODEOWNERS
- Adds the
\{artifactId\}-plugin-developersteam to all files in.github/CODEOWNERSif absent.
org.openrewrite.recipe:rewrite-liberty
- org.openrewrite.java.liberty.RemoveWas2LibertyNonPortableJndiLookup
- Removes invalid JNDI properties
- Remove the use of invalid JNDI properties from Hashtable.
org.openrewrite.recipe:rewrite-micronaut
- org.openrewrite.java.micronaut.AddAnnotationProcessorPath
- Add Maven annotation processor path
- Add the groupId, artifactId, version, and exclusions of a Maven annotation processor path.
- org.openrewrite.java.micronaut.AddSnakeYamlDependencyIfNeeded
- Add
snakeyamldependency if needed - This recipe will add the
snakeyamldependency to a Micronaut 4 application that uses yaml configuration.
- Add
- org.openrewrite.java.micronaut.CopyNonInheritedAnnotations
- Copy non-inherited annotations from super class
- As of Micronaut 3.x only annotations that are explicitly meta-annotated with
@Inheritedare inherited from parent classes and interfaces.
- org.openrewrite.java.micronaut.TypeRequiresIntrospection
- Add
@Introspectedto classes requiring a map representation - In Micronaut 2.x a reflection-based strategy was used to retrieve that information if the class was not annotated with
@Introspected. As of Micronaut 3.x it is required to annotate classes with@Introspectedthat are used in this way.
- Add
org.openrewrite.recipe:rewrite-migrate-java
- org.openrewrite.java.migrate.AddStaticVariableOnProducerSessionBean
- Adds
staticmodifier to@Producesfields that are in session beans - Ensures that the fields annotated with
@Produceswhich is inside the session bean (@Stateless,@Stateful, or@Singleton) are declaredstatic.
- Adds
- org.openrewrite.java.migrate.jakarta.HasNoJakartaAnnotations
- Project has no Jakarta annotations
- Mark all source as found per
JavaProjectwhere no Jakarta annotations are found. This is useful mostly as a precondition for recipes that require Jakarta annotations to be present.
- org.openrewrite.java.migrate.javax.AddJaxbRuntime
- Use latest JAXB API and runtime for Jakarta EE 8
- Update build files to use the latest JAXB runtime from Jakarta EE 8 to maintain compatibility with Java version 11 or greater. The recipe will add a JAXB run-time, in Gradle
compileOnly+testImplementationand Mavenprovidedscope, to any project that has a transitive dependency on the JAXB API. The resulting dependencies still use thejavaxnamespace, despite the move to the Jakarta artifact.
- org.openrewrite.java.migrate.javax.AddScopeToInjectedClass
- Add scope annotation to injected classes
- Finds member variables annotated with
@Inject' and applies@Dependent` scope annotation to the variable's type.
- org.openrewrite.java.migrate.javax.AddTransientAnnotationToEntity
- Unannotated entity attributes require a Transient annotation
- In OpenJPA, attributes that are themselves entity classes are not persisted by default. EclipseLink has a different default behavior and tries to persist these attributes to the database. To keep the OpenJPA behavior of ignoring unannotated entity attributes, add the
javax.persistence.Transientannotation to these attributes in EclipseLink.
- org.openrewrite.java.migrate.javax.RemoveEmbeddableId
@Embeddableclasses cannot have an@Idannotation when referenced by an@EmbeddedIdannotation- According to the Java Persistence API (JPA) specification, if an entity defines an attribute with an
@EmbeddedIdannotation, the embeddable class cannot contain an attribute with an@Idannotation. If both the@EmbeddedIdannotation and the@Idannotation are defined, OpenJPA ignores the@Idannotation, whereas EclipseLink throws an exception.
- org.openrewrite.java.migrate.lombok.AdoptLombokGetterMethodNames
- Rename getter methods to fit Lombok
- Rename methods that are effectively getter to the name Lombok would give them. Limitations: - If two methods in a class are effectively the same getter then one's name will be corrected and the others name will be left as it is. - If the correct name for a method is already taken by another method then the name will not be corrected. - Method name swaps or circular renaming within a class cannot be performed because the names block each other. E.g.
int getFoo() \{ return ba; \} int getBa() \{ return foo; \}stays as it is.
- org.openrewrite.java.migrate.lombok.AdoptLombokSetterMethodNames
- Rename setter methods to fit Lombok
- Rename methods that are effectively setter to the name Lombok would give them. Limitations: - If two methods in a class are effectively the same setter then one's name will be corrected and the others name will be left as it is. - If the correct name for a method is already taken by another method then the name will not be corrected. - Method name swaps or circular renaming within a class cannot be performed because the names block each other. E.g.
int getFoo() \{ return ba; \} int getBa() \{ return foo; \}stays as it is.
- org.openrewrite.java.migrate.lombok.LombokValueToRecord
- Convert
@lombok.Valueclass to Record - Convert Lombok
@Valueannotated classes to standard Java Records.
- Convert
- org.openrewrite.java.migrate.search.PlanJavaMigration
- Plan a Java version migration
- Study the set of Java versions and associated tools in use across many repositories.
org.openrewrite.recipe:rewrite-openapi
- org.openrewrite.openapi.swagger.ConvertApiResponseCodesToStrings
- Convert API response codes to strings
- Convert API response codes to strings. Handles literal integers, local constant references, and external constant field accesses.
org.openrewrite.recipe:rewrite-prethink
- org.openrewrite.prethink.ExportContext
- Export context files
- Export DataTables to CSV files in
.moderne/context/along with a markdown description file. The markdown file describes the context and includes schema information for each data table.
- org.openrewrite.prethink.UpdateAgentConfig
- Update agent configuration files
- Update coding agent configuration files (CLAUDE.md, .cursorrules, etc.) to include references to Moderne Prethink context files in .moderne/context/.
- org.openrewrite.prethink.calm.GenerateCalmArchitecture
- Generate CALM architecture
- Generate a FINOS CALM (Common Architecture Language Model) JSON file from discovered service endpoints, database connections, external service calls, and messaging connections.
org.openrewrite.recipe:rewrite-rewrite
- org.openrewrite.java.recipes.ExamplesExtractor
- Extract documentation examples from tests
- Extract the before/after sources from tests annotated with
@DocumentExample, and generate a YAML file with those examples to be shown in the documentation to show usage.
- org.openrewrite.java.recipes.GenerateDeprecatedMethodRecipes
- Generate
InlineMethodCallsrecipes for deprecated delegating methods - Finds
@Deprecatedmethod declarations whose body is a single delegation call to another method in the same class, and generates a declarative YAML recipe file containingInlineMethodCallsentries for each.
- Generate
org.openrewrite.recipe:rewrite-spring
- org.openrewrite.java.spring.RenameBean
- Rename bean
- Renames a Spring bean, both declaration and references.
- org.openrewrite.java.spring.SeparateApplicationPropertiesByProfile
- Separate
application.propertiesby profile - Separating
application.propertiesinto separate files based on profiles.
- Separate
- org.openrewrite.java.spring.SeparateApplicationYamlByProfile
- Separate application YAML by profile
- The Spring team's recommendation is to separate profile properties into their own YAML files now.
- org.openrewrite.java.spring.UpdateApiManifest
- Update the API manifest
- Keep a consolidated manifest of the API endpoints that this application exposes up-to-date.
- org.openrewrite.java.spring.boot2.MergeBootstrapYamlWithApplicationYaml
- Merge Spring
bootstrap.ymlwithapplication.yml - In Spring Boot 2.4, support for
bootstrap.ymlwas removed. It's properties should be merged withapplication.yml.
- Merge Spring
- org.openrewrite.java.spring.boot2.MoveAutoConfigurationToImportsFile
- Use
AutoConfiguration#imports - Use
AutoConfiguration#importsinstead of the deprecated entryEnableAutoConfigurationinspring.factorieswhen defining autoconfiguration classes.
- Use
- org.openrewrite.java.spring.boot2.search.IntegrationSchedulerPoolRecipe
- Integration scheduler pool size
- Spring Integration now reuses an available
TaskSchedulerrather than configuring its own. In a typical application setup relying on the auto-configuration, this means that Spring Integration uses the auto-configured task scheduler that has a pool size of 1. To restore Spring Integration’s default of 10 threads, use thespring.task.scheduling.pool.sizeproperty.
- org.openrewrite.java.spring.boot2.search.LoggingShutdownHooks
- Applications using logging shutdown hooks
- Spring Boot registers a logging shutdown hook by default for JAR-based applications to ensure that logging resources are released when the JVM exits. If your application is deployed as a WAR then the shutdown hook is not registered since the servlet container usually handles logging concerns. Most applications will want the shutdown hook. However, if your application has complex context hierarchies, then you may need to disable it. You can use the
logging.register-shutdown-hookproperty to do that.
- org.openrewrite.java.spring.boot3.MaintainTrailingSlashURLMappings
- Maintain trailing slash URL mappings
- This is part of Spring MVC and WebFlux URL Matching Changes, as of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to false. This means that previously, a controller
@GetMapping("/some/greeting")would match bothGET /some/greetingandGET /some/greeting/, but it doesn't matchGET /some/greeting/anymore by default and will result in an HTTP 404 error. This recipe is to maintain trailing slash in all HTTP url mappings.
- org.openrewrite.java.spring.boot3.MigrateHooksToReactorContextProperty
- Use
spring.reactor.context-propagationproperty - Replace
Hooks.enableAutomaticContextPropagation()withspring.reactor.context-propagation=auto.
- Use
- org.openrewrite.java.spring.cloud2022.AddLoggingPatternLevelForSleuth
- Add logging.pattern.level for traceId and spanId
- Add
logging.pattern.levelfor traceId and spanId which was previously set by default, if not already set.
- org.openrewrite.java.spring.doc.MigrateDocketBeanToGroupedOpenApiBean
- Migrate
DockettoGroupedOpenAPI - Migrate a
Docketbean to aGroupedOpenAPIbean preserving group name, packages and paths. When possible the recipe will prefer property based configuration.
- Migrate
- org.openrewrite.maven.spring.UpgradeExplicitSpringBootDependencies
- Upgrade Spring dependencies
- Upgrades dependencies according to the specified version of spring boot. Spring boot has many direct and transitive dependencies. When a module has an explicit dependency on one of these it may also need to be upgraded to match the version used by spring boot.
org.openrewrite.recipe:rewrite-static-analysis
- org.openrewrite.staticanalysis.LowercasePackage
- Rename packages to lowercase
- By convention all Java package names should contain only lowercase letters, numbers, and dashes. This recipe converts any uppercase letters in package names to be lowercase.
- org.openrewrite.staticanalysis.MethodNameCasing
- Standardize method name casing
- Fixes method names that do not follow standard naming conventions. For example,
String getFoo_bar()would be adjusted toString getFooBar()andint DoSomething()would be adjusted toint doSomething().
org.openrewrite.recipe:rewrite-testing-frameworks
- org.openrewrite.java.testing.cleanup.TestsShouldNotBePublic
- Remove
publicvisibility of JUnit 5 tests - Remove
publicand optionallyprotectedmodifiers from methods with@Test,@ParameterizedTest,@RepeatedTest,@TestFactory,@BeforeEach,@AfterEach,@BeforeAll, or@AfterAll. They no longer have to be public visibility to be usable by JUnit 5.
- Remove
- org.openrewrite.java.testing.junit5.AddHamcrestJUnitDependency
- Add Hamcrest JUnit dependency
- Add Hamcrest JUnit dependency only if JUnit 4's
assertThatorassumeThatis used.
- org.openrewrite.java.testing.junit5.AddJupiterDependencies
- Add JUnit Jupiter dependencies
- Adds JUnit Jupiter dependencies to a Maven or Gradle project. JUnit Jupiter can be added either with the artifact
junit-jupiter, or both ofjunit-jupiter-apiandjunit-jupiter-engine. This addsjunit-jupiterdependency unlessjunit-jupiter-apiorjunit-jupiter-engineare already present.
- org.openrewrite.java.testing.mockito.AnyToNullable
- Replace Mockito 1.x
anyString()/any()withnullable(Class) - Since Mockito 2.10
anyString()andany()no longer matches null values. Usenullable(Class)instead.
- Replace Mockito 1.x
- org.openrewrite.java.testing.mockito.ReplacePowerMockDependencies
- Replace PowerMock dependencies with Mockito equivalents
- Replaces PowerMock API dependencies with
mockito-inlinewhenmockStatic(),whenNew(), or@PrepareForTestusage is detected, ormockito-coreotherwise. PowerMock features like static mocking, constructor mocking, and final class mocking require the inline mock maker which is bundled inmockito-inlinefor Mockito 3.x/4.x.
- org.openrewrite.java.testing.mockito.VerifyZeroToNoMoreInteractions
- Replace
verifyZeroInteractions()withverifyNoMoreInteractions() - Replaces
verifyZeroInteractions()withverifyNoMoreInteractions()in Mockito tests when migration when using a Mockito version < 3.x.
- Replace
org.openrewrite:rewrite-core
- org.openrewrite.AddToGitignore
- Add entries to
.gitignore - Adds entries to the project's
.gitignorefile. If no.gitignorefile exists, one will be created. Existing entries that match will not be duplicated.
- Add entries to
- 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.FindGitProvenance
- Show Git source control metadata
- List out the contents of each unique
GitProvenancemarker 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.ListRuntimeClasspath
- List runtime classpath
- A diagnostic utility which emits the runtime classpath to a data table.
- org.openrewrite.search.FindCommitters
- Find committers on repositories
- List the committers on a repository.
- 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
SearchResultmarker. If you want to get only the matching file as a search result, useFindSourceFilesinstead.
- 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
Quarkrather than plain text. In such case, use theplainTextMaskoption. See the Gradle or Maven plugin configuration page.
- org.openrewrite.text.CreateTextFile
- Create text file
- Creates a new plain text file.
org.openrewrite:rewrite-gradle
- org.openrewrite.gradle.AddDependency
- Add Gradle dependency
- Add a gradle dependency to a
build.gradlefile in the correct configuration based on where it is used.
- org.openrewrite.gradle.AddPlatformDependency
- Add Gradle platform dependency
- Add a gradle platform dependency to a
build.gradlefile in the correct configuration based on where it is used.
- org.openrewrite.gradle.AddProperty
- Add Gradle property
- Add a property to the
gradle.propertiesfile.
- org.openrewrite.gradle.ChangeDependency
- Change Gradle dependency
- Change a Gradle dependency coordinates. The
newGroupIdornewArtifactIdMUST be different from before.
- org.openrewrite.gradle.MigrateDependenciesToVersionCatalog
- Migrate Gradle project dependencies to version catalog
- Migrates Gradle project dependencies to use the version catalog feature. Supports migrating dependency declarations of various forms: *
Stringnotation:"group:artifact:version"*Mapnotation:group: 'group', name: 'artifact', version: 'version'* Property references:"group:artifact:$version"or"group:artifact:$\{version\}"The recipe will: * Create agradle/libs.versions.tomlfile with version declarations * Replace dependency declarations with catalog references (e.g.,libs.springCore) * Migrate version properties fromgradle.propertiesto the version catalog * Preserve project dependencies unchanged Note: If a version catalog already exists, the recipe will not modify it.
- org.openrewrite.gradle.UpdateGradleWrapper
- Update Gradle wrapper
- Update the version of Gradle used in an existing Gradle wrapper. Queries
downloads.gradle.orgto determine the available releases, but prefers the artifact repository URL which already exists within the wrapper properties file. If your artifact repository does not contain the same Gradle distributions asdownloads.gradle.org, then the recipe may suggest a version which is not available in your artifact repository.
- org.openrewrite.gradle.UpgradeDependencyVersion
- Upgrade Gradle dependency versions
- Upgrade the version of a dependency in a build.gradle file. Supports updating dependency declarations of various forms: *
Stringnotation:"group:artifact:version"*Mapnotation:group: 'group', name: 'artifact', version: 'version'Can update version numbers which are defined earlier in the same file in variable declarations.
- org.openrewrite.gradle.UpgradeTransitiveDependencyVersion
- Upgrade transitive Gradle dependencies
- Upgrades the version of a transitive dependency in a Gradle build file. There are many ways to do this in Gradle, so the mechanism for upgrading a transitive dependency must be considered carefully depending on your style of dependency management.
- org.openrewrite.gradle.plugins.UpgradePluginVersion
- Update a Gradle plugin by id
- Update a Gradle plugin by id to a later version defined by the plugins DSL. To upgrade a plugin dependency defined by
buildscript.dependencies, use theUpgradeDependencyVersionrecipe instead.
- org.openrewrite.gradle.search.ModuleHasDependency
- Module has dependency
- Searches for Gradle Projects (modules) that have a dependency matching the specified id or implementing class. Places a
SearchResultmarker on all sources within a project 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 that use the dependency, use theFindDependencyrecipe instead.
- org.openrewrite.gradle.search.ModuleHasPlugin
- Module has plugin
- Searches for Gradle Projects (modules) that have a plugin matching the specified id or implementing class. Places a
SearchResultmarker on all sources within a project 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 dependency management plugin, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file applying the plugin, use theFindPluginsrecipe instead.
org.openrewrite:rewrite-hcl
- org.openrewrite.hcl.MoveContentToFile
- Move content to another file
- Move content to another HCL file, deleting it in the original file.
org.openrewrite:rewrite-java
- org.openrewrite.java.CreateEmptyJavaClass
- Create Java class
- Create a new, empty Java class.
- org.openrewrite.java.search.ClasspathTypeCounts
- Study the size of the classpath by source set
- Emit one data table row per source set in a project, with the number of types in the source set.
- org.openrewrite.java.search.FindDistinctMethods
- Find distinct methods in use
- A sample of every distinct method in use in a repository. The code sample in the method calls data table will be a representative use of the method, though there may be many other such uses of the method.
- org.openrewrite.java.search.FindTypeMappings
- Find type mappings
- Study the frequency of
Jtypes and theirJavaTypetype attribution.
- org.openrewrite.java.search.HasMinimumJavaVersion
- Find the oldest Java version in use
- The oldest Java version in use is the lowest Java version in use in any source set of any subproject of a repository. It is possible that, for example, the main source set of a project uses Java 8, but a test source set uses Java 17. In this case, the oldest Java version in use is Java 8.
- org.openrewrite.java.search.ModuleContainsFile
- Module contains file
- Intended to be used primarily as a precondition for other recipes, this recipe checks if a module contains a specific file or files matching a pattern. Only files belonging to modules containing the specified file are marked with a
SearchResultmarker. This is more specific thanRepositoryContainsFilewhich marks all files in the repository if any file matches.
- org.openrewrite.java.search.ModuleUsesType
- Module uses type
- Intended to be used primarily as a precondition for other recipes, this recipe checks if a module uses a specified type. Only files belonging to modules that use the specified type are marked with a
SearchResultmarker. This is more specific thanUsesTypewhich only marks the files that directly use the type.
org.openrewrite:rewrite-json
- org.openrewrite.json.CopyValue
- Copy JSON value
- Copies a JSON value from one key to another. The existing key/value pair remains unaffected by this change. Attempts to create the new key if it does not exist.
- org.openrewrite.json.CreateJsonFile
- Create JSON file
- Create a new JSON file.
org.openrewrite:rewrite-maven
- org.openrewrite.maven.AddAnnotationProcessor
- Add an annotation processor to
maven-compiler-plugin - Add an annotation processor path to the
maven-compiler-pluginconfiguration. For modules with an in-reactor parent, adds to the parent'sbuild/pluginManagement/pluginssection. For modules without a parent or with a parent outside the reactor, adds directly tobuild/plugins. Updates the annotation processor version if a newer version is specified.
- Add an annotation processor to
- org.openrewrite.maven.AddDependency
- Add Maven dependency
- Add a Maven dependency to a
pom.xmlfile 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-extensionis added to the.mvn/extensions.xmlfile if not already present. Additionally, configure the extension by adding the.mvn/develocity.xmlconfiguration file.
- org.openrewrite.maven.AddManagedDependency
- Add managed Maven dependency
- Add a managed Maven dependency to a
pom.xmlfile.
- 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.ChangeDependencyGroupIdAndArtifactId
- Change Maven dependency
- Change a Maven dependency coordinates. The
newGroupIdornewArtifactIdMUST be different from before. Matching<dependencyManagement>coordinates are also updated if anewVersionorversionPatternis 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.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.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.RemoveUnusedProperties
- Remove unused properties
- Detect and remove Maven property declarations which do not have any usage within the project.
- org.openrewrite.maven.UpdateMavenWrapper
- Update Maven wrapper
- Update the version of Maven used in an existing Maven wrapper.
- 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.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.search.ModuleHasDependency
- Module has dependency
- Searches for Maven modules that have a dependency matching the specified groupId and artifactId. Places a
SearchResultmarker 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 theFindDependencyrecipe 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
SearchResultmarker 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 theFindPluginsrecipe instead.
org.openrewrite:rewrite-properties
- org.openrewrite.properties.CreatePropertiesFile
- Create Properties file
- Create a new Properties file.
org.openrewrite:rewrite-toml
- org.openrewrite.toml.CreateTomlFile
- Create TOML file
- Create a new TOML file.
org.openrewrite:rewrite-xml
- org.openrewrite.xml.CreateXmlFile
- Create XML file
- Create a new XML file.
- org.openrewrite.xml.style.AutodetectDebug
- XML style Auto-detection debug
- Runs XML Autodetect and records the results in data tables and search markers. A debugging tool for figuring out why XML documents get styled the way they do.
org.openrewrite:rewrite-yaml
- org.openrewrite.yaml.CopyValue
- Copy YAML value
- Copies a YAML value from one key to another. The existing key/value pair remains unaffected by this change. Attempts to merge the copied value into the new key if it already exists. By default, attempts to create the new key if it does not exist.
- org.openrewrite.yaml.CreateYamlFile
- Create YAML file
- Create a new YAML file.