From 6e8afeb24787af70c0ce0c913100174c8b3562fc Mon Sep 17 00:00:00 2001 From: Kang-Jin Kim Date: Sun, 25 Jan 2026 16:32:06 +0900 Subject: [PATCH 1/8] Add NoHttpExchangeAnnotation --- .../java/spring/NoHttpExchangeAnnotation.java | 120 +++++++++ .../spring/NoHttpExchangeAnnotationTest.java | 234 ++++++++++++++++++ 2 files changed, 354 insertions(+) create mode 100644 src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java create mode 100644 src/test/java/org/openrewrite/java/spring/NoHttpExchangeAnnotationTest.java diff --git a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java new file mode 100644 index 000000000..662ebfd9f --- /dev/null +++ b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java @@ -0,0 +1,120 @@ +package org.openrewrite.java.spring; + +import java.util.Optional; + +import org.jspecify.annotations.Nullable; +import org.openrewrite.ExecutionContext; +import org.openrewrite.Preconditions; +import org.openrewrite.Recipe; +import org.openrewrite.TreeVisitor; +import org.openrewrite.internal.ListUtils; +import org.openrewrite.java.AnnotationMatcher; +import org.openrewrite.java.ChangeType; +import org.openrewrite.java.JavaIsoVisitor; +import org.openrewrite.java.search.UsesType; +import org.openrewrite.java.tree.J; +import org.openrewrite.java.tree.Space; + +import lombok.Getter; + +public class NoHttpExchangeAnnotation extends Recipe { + + @Getter + final String displayName = "Remove `HttpExchange` annotations"; + + @Getter + final String description = "Replace method declaration `@HttpExchange` annotations with `@GetExchange`, `@PostExchange`, etc."; + + @Override + public TreeVisitor getVisitor() { + return Preconditions.check( + new UsesType<>("org.springframework.web.service.annotation.HttpExchange", false), + new NoHttpExchangeAnnotationVisitor()); + } + + private static class NoHttpExchangeAnnotationVisitor extends JavaIsoVisitor { + private static final AnnotationMatcher HTTP_EXCHANGE_ANNOTATION_MATCHER = new AnnotationMatcher("@org.springframework.web.service.annotation.HttpExchange"); + + @Override + public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext ctx) { + J.Annotation a = super.visitAnnotation(annotation, ctx); + if (HTTP_EXCHANGE_ANNOTATION_MATCHER.matches(a) && getCursor().getParentOrThrow().getValue() instanceof J.MethodDeclaration) { + Optional methodArg = findMethodArgument(a); + Optional httpMethod = methodArg.map(this::extractHttpMethod); + String targetAnnotationClassName = httpMethod.map(this::toExchangeAnnotation).orElse(null); + + if (targetAnnotationClassName == null) { + return a; + } + + maybeRemoveImport("org.springframework.web.service.annotation.HttpExchange"); + + if (a.getArguments() != null) { + a = a.withArguments(ListUtils.map(a.getArguments(), arg -> + methodArg.get().equals(arg) ? null : arg)); + } + + maybeAddImport("org.springframework.web.service.annotation." + targetAnnotationClassName); + a = (J.Annotation)new ChangeType( + "org.springframework.web.service.annotation.HttpExchange", + "org.springframework.web.service.annotation." + targetAnnotationClassName, + false + ).getVisitor().visit(a, ctx, getCursor().getParentOrThrow()); + + if (a != null && a.getArguments() != null && a.getArguments().size() == 1) { + a = a.withArguments(ListUtils.map(a.getArguments(), arg -> { + if (arg instanceof J.Assignment && ((J.Assignment)arg).getVariable() instanceof J.Identifier) { + J.Identifier ident = (J.Identifier)((J.Assignment)arg).getVariable(); + if ("value".equals(ident.getSimpleName()) || "url".equals(ident.getSimpleName())) { + return ((J.Assignment)arg).getAssignment().withPrefix(Space.EMPTY); + } + } + return arg; + })); + } + } + return a != null ? a : annotation; + } + + private Optional findMethodArgument(J.Annotation annotation) { + if (annotation.getArguments() == null) { + return Optional.empty(); + } + + return annotation.getArguments().stream() + .filter(arg -> arg instanceof J.Assignment && + ((J.Assignment)arg).getVariable() instanceof J.Identifier && + "method".equals(((J.Identifier)((J.Assignment)arg).getVariable()).getSimpleName())) + .map(J.Assignment.class::cast) + .findFirst(); + } + + private @Nullable String extractHttpMethod(J.@Nullable Assignment assignment) { + if (assignment == null) { + return null; + } + + if (assignment.getAssignment() instanceof J.Literal) { + Object value = ((J.Literal)assignment.getAssignment()).getValue(); + if (value instanceof String) { + return (String)value; + } + } + + return null; + } + + private @Nullable String toExchangeAnnotation(String method) { + switch (method) { + case "GET": + case "POST": + case "PUT": + case "PATCH": + case "DELETE": + return method.charAt(0) + method.toLowerCase().substring(1) + "Exchange"; + default: + return null; + } + } + } +} diff --git a/src/test/java/org/openrewrite/java/spring/NoHttpExchangeAnnotationTest.java b/src/test/java/org/openrewrite/java/spring/NoHttpExchangeAnnotationTest.java new file mode 100644 index 000000000..b267a9951 --- /dev/null +++ b/src/test/java/org/openrewrite/java/spring/NoHttpExchangeAnnotationTest.java @@ -0,0 +1,234 @@ +/* + * Copyright 2024 the original author or authors. + *

+ * Licensed under the Moderne Source Available License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * https://docs.moderne.io/licensing/moderne-source-available-license + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.openrewrite.java.spring; + +import static org.openrewrite.java.Assertions.java; + +import org.junit.jupiter.api.Test; +import org.openrewrite.DocumentExample; +import org.openrewrite.InMemoryExecutionContext; +import org.openrewrite.java.JavaParser; +import org.openrewrite.test.RecipeSpec; +import org.openrewrite.test.RewriteTest; + +class NoHttpExchangeAnnotationTest implements RewriteTest { + + @Override + public void defaults(RecipeSpec spec) { + spec.recipe(new NoHttpExchangeAnnotation()) + .parser(JavaParser.fromJavaVersion() + .classpathFromResources(new InMemoryExecutionContext(), "spring-web-6.+")); + } + + @DocumentExample + @Test + void getExchange() { + rewriteRun( + java( + """ + import org.springframework.web.service.annotation.HttpExchange; + + interface UserApi { + @HttpExchange(method = "GET", value = "/api/users") + String getUsers(); + } + """, + """ + import org.springframework.web.service.annotation.GetExchange; + + interface UserApi { + @GetExchange("/api/users") + String getUsers(); + } + """ + ) + ); + } + + @Test + void postExchange() { + rewriteRun( + java( + """ + import org.springframework.web.service.annotation.HttpExchange; + + interface UserApi { + @HttpExchange(method = "POST", value = "/api/users") + String postUser(); + } + """, + """ + import org.springframework.web.service.annotation.PostExchange; + + interface UserApi { + @PostExchange("/api/users") + String postUser(); + } + """ + ) + ); + } + + @Test + void putExchange() { + rewriteRun( + java( + """ + import org.springframework.web.service.annotation.HttpExchange; + + interface UserApi { + @HttpExchange(method = "PUT", value = "/api/users/{id}") + String putUser(); + } + """, + """ + import org.springframework.web.service.annotation.PutExchange; + + interface UserApi { + @PutExchange("/api/users/{id}") + String putUser(); + } + """ + ) + ); + } + + @Test + void patchExchange() { + rewriteRun( + java( + """ + import org.springframework.web.service.annotation.HttpExchange; + + interface UserApi { + @HttpExchange(method = "PATCH", value = "/api/users/{id}") + String patchUser(); + } + """, + """ + import org.springframework.web.service.annotation.PatchExchange; + + interface UserApi { + @PatchExchange("/api/users/{id}") + String patchUser(); + } + """ + ) + ); + } + + @Test + void deleteExchange() { + rewriteRun( + java( + """ + import org.springframework.web.service.annotation.HttpExchange; + + interface UserApi { + @HttpExchange(method = "DELETE", value = "/api/users") + String deleteUser(); + } + """, + """ + import org.springframework.web.service.annotation.DeleteExchange; + + interface UserApi { + @DeleteExchange("/api/users") + String deleteUser(); + } + """ + ) + ); + } + + @Test + void methodOnlyWithoutValue() { + rewriteRun( + java( + """ + import org.springframework.web.service.annotation.HttpExchange; + + interface UserApi { + @HttpExchange(method = "GET") + String getUsers(); + } + """, + """ + import org.springframework.web.service.annotation.GetExchange; + + interface UserApi { + @GetExchange + String getUsers(); + } + """ + ) + ); + } + + @Test + void noMethodArgument() { + rewriteRun( + java( + """ + import org.springframework.web.service.annotation.HttpExchange; + + interface UserApi { + @HttpExchange("/api/users") + String getUsers(); + } + """ + ) + ); + } + + @Test + void multipleMethods() { + rewriteRun( + java( + """ + import org.springframework.web.service.annotation.HttpExchange; + + interface UserApi { + @HttpExchange(method = "GET", value = "/api/users") + String getUsers(); + + @HttpExchange(method = "POST", value = "/api/users") + String createUser(); + + @HttpExchange(method = "DELETE", value = "/api/users/{id}") + void deleteUser(); + } + """, + """ + import org.springframework.web.service.annotation.DeleteExchange; + import org.springframework.web.service.annotation.GetExchange; + import org.springframework.web.service.annotation.PostExchange; + + interface UserApi { + @GetExchange("/api/users") + String getUsers(); + + @PostExchange("/api/users") + String createUser(); + + @DeleteExchange("/api/users/{id}") + void deleteUser(); + } + """ + ) + ); + } +} From e693292135b7f0afe9c518b1a56bac9ee3ba063a Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Sun, 25 Jan 2026 08:50:33 +0100 Subject: [PATCH 2/8] Apply suggestions from code review Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .../java/spring/NoHttpExchangeAnnotation.java | 22 ++++++++++++++++--- .../spring/NoHttpExchangeAnnotationTest.java | 4 ++-- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java index 662ebfd9f..28bffd4a4 100644 --- a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java +++ b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java @@ -1,5 +1,21 @@ -package org.openrewrite.java.spring; - +/* + * Copyright 2026 the original author or authors. + *

+ * Licensed under the Moderne Source Available License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * https://docs.moderne.io/licensing/moderne-source-available-license + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.openrewrite.java.spring; + +import lombok.Getter; import java.util.Optional; import org.jspecify.annotations.Nullable; @@ -15,7 +31,7 @@ import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.Space; -import lombok.Getter; +import java.util.Optional; public class NoHttpExchangeAnnotation extends Recipe { diff --git a/src/test/java/org/openrewrite/java/spring/NoHttpExchangeAnnotationTest.java b/src/test/java/org/openrewrite/java/spring/NoHttpExchangeAnnotationTest.java index b267a9951..204b4a8b7 100644 --- a/src/test/java/org/openrewrite/java/spring/NoHttpExchangeAnnotationTest.java +++ b/src/test/java/org/openrewrite/java/spring/NoHttpExchangeAnnotationTest.java @@ -15,8 +15,6 @@ */ package org.openrewrite.java.spring; -import static org.openrewrite.java.Assertions.java; - import org.junit.jupiter.api.Test; import org.openrewrite.DocumentExample; import org.openrewrite.InMemoryExecutionContext; @@ -24,6 +22,8 @@ import org.openrewrite.test.RecipeSpec; import org.openrewrite.test.RewriteTest; +import static org.openrewrite.java.Assertions.java; + class NoHttpExchangeAnnotationTest implements RewriteTest { @Override From 63f399dd5a11f7fff427afdceca5a9d88bca88ee Mon Sep 17 00:00:00 2001 From: Kang-Jin Kim Date: Sun, 25 Jan 2026 19:33:27 +0900 Subject: [PATCH 3/8] add javadoc for describe receipe --- .../java/spring/NoHttpExchangeAnnotation.java | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java index 28bffd4a4..e3e3f8e42 100644 --- a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java +++ b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java @@ -13,9 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openrewrite.java.spring; - -import lombok.Getter; +package org.openrewrite.java.spring; + import java.util.Optional; import org.jspecify.annotations.Nullable; @@ -31,7 +30,20 @@ import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.Space; -import java.util.Optional; +import lombok.Getter; + +/** + * Replace method declaration @HttpExchange annotations with the associated variant + * as defined by the request method type (GET, POST, PUT, PATCH, DELETE) + *

+ *

    + *
  • @HttpExchange(method = "GET") changes to @GetExchange + *
  • @HttpExchange(method = "POST") changes to @PostExchange + *
  • @HttpExchange(method = "PATCH") changes to @PatchExchange + *
  • @HttpExchange(method = "PUT") changes to @PutExchange + *
  • @HttpExchange(method = "DELETE") changes to @DeleteExchange + *
+ */ public class NoHttpExchangeAnnotation extends Recipe { From 203d73553785a84faad33bab8530ad8a752dc7bf Mon Sep 17 00:00:00 2001 From: Kang-Jin Kim Date: Sun, 25 Jan 2026 21:47:41 +0900 Subject: [PATCH 4/8] add NoHttpExchangeAnnotation to Recipe.csv --- .../resources/META-INF/rewrite/recipes.csv | 61 ++++++++++--------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/src/main/resources/META-INF/rewrite/recipes.csv b/src/main/resources/META-INF/rewrite/recipes.csv index c7ca01db6..d2f1f8e8d 100644 --- a/src/main/resources/META-INF/rewrite/recipes.csv +++ b/src/main/resources/META-INF/rewrite/recipes.csv @@ -3,12 +3,13 @@ maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.gradle.spring.AddSpr maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.AddSpringProperty,Add a spring configuration property,Add a spring configuration property to a configuration file if it does not already exist in that file.,1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,"[{""name"":""property"",""type"":""String"",""displayName"":""Property key"",""description"":""The property key to add."",""example"":""management.metrics.enable.process.files"",""required"":true},{""name"":""value"",""type"":""String"",""displayName"":""Property value"",""description"":""The value of the new property key."",""example"":""true"",""required"":true},{""name"":""comment"",""type"":""String"",""displayName"":""Optional comment to be prepended to the property"",""description"":""A comment that will be added to the new property."",""example"":""This is a comment""},{""name"":""pathExpressions"",""type"":""List"",""displayName"":""Optional list of file path matcher"",""description"":""Each value in this list represents a glob expression that is used to match which files will be modified. If this value is not present, this recipe will query the execution context for reasonable defaults. (\""**/application.yml\"", \""**/application.yml\"", and \""**/application.properties\""."",""example"":""[\""**/application.yml\""]""}]", maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.ChangeMethodParameter,Change parameter type for a method declaration,"Change parameter type for a method declaration, identified by a method pattern.",1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,"[{""name"":""methodPattern"",""type"":""String"",""displayName"":""Method pattern"",""description"":""A method pattern that is used to find the method declarations to modify."",""example"":""com.yourorg.A foo(int, int)"",""required"":true},{""name"":""parameterType"",""type"":""String"",""displayName"":""Parameter type"",""description"":""The new type of the parameter that gets updated."",""example"":""java.lang.String"",""required"":true},{""name"":""parameterIndex"",""type"":""Integer"",""displayName"":""Parameter index"",""description"":""A zero-based index that indicates the position at which the parameter will be added."",""example"":""0"",""required"":true}]", maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.ChangeSpringPropertyKey,Change the key of a Spring application property,"Change Spring application property keys existing in either Properties or YAML files, and in `@Value`, `@ConditionalOnProperty` or `@SpringBootTest` annotations.",1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,"[{""name"":""oldPropertyKey"",""type"":""String"",""displayName"":""Old property key"",""description"":""The property key to rename."",""example"":""management.metrics.binders.*.enabled"",""required"":true},{""name"":""newPropertyKey"",""type"":""String"",""displayName"":""New property key"",""description"":""The new name for the property key."",""example"":""management.metrics.enable.process.files"",""required"":true},{""name"":""except"",""type"":""List"",""displayName"":""Except"",""description"":""Regex. If any of these property keys exist as direct children of `oldPropertyKey`, then they will not be moved to `newPropertyKey`."",""example"":""jvm""}]", -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.ChangeSpringPropertyValue,Change the value of a spring application property,Change spring application property values existing in either Properties or Yaml files.,1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,"[{""name"":""propertyKey"",""type"":""String"",""displayName"":""Property key"",""description"":""The name of the property key whose value is to be changed."",""example"":""management.metrics.binders.files.enabled"",""required"":true},{""name"":""newValue"",""type"":""String"",""displayName"":""New value"",""description"":""The new value to be used for key specified by `propertyKey`."",""example"":""management.metrics.enable.process.files"",""required"":true},{""name"":""oldValue"",""type"":""String"",""displayName"":""Old value"",""description"":""Only change the property value if it matches the configured `oldValue`."",""example"":""false""},{""name"":""regex"",""type"":""Boolean"",""displayName"":""Regex"",""description"":""Default false. If enabled, `oldValue` will be interpreted as a Regular Expression, and capture group contents will be available in `newValue`""},{""name"":""relaxedBinding"",""type"":""Boolean"",""displayName"":""Use relaxed binding"",""description"":""Whether to match the `propertyKey` using [relaxed binding](https://docs.spring.io/spring-boot/docs/2.5.6/reference/html/features.html#features.external-config.typesafe-configuration-properties.relaxed-binding) rules. Default is `true`. Set to `false` to use exact matching.""}]", +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.ChangeSpringPropertyValue,Change the value of a spring application property,"Change Spring application property values existing in either Properties or YAML files, and in `@Value`, `@ConditionalOnProperty`, `@SpringBootTest`, or `@TestPropertySource` annotations.",1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,"[{""name"":""propertyKey"",""type"":""String"",""displayName"":""Property key"",""description"":""The name of the property key whose value is to be changed."",""example"":""management.metrics.binders.files.enabled"",""required"":true},{""name"":""newValue"",""type"":""String"",""displayName"":""New value"",""description"":""The new value to be used for key specified by `propertyKey`."",""example"":""management.metrics.enable.process.files"",""required"":true},{""name"":""oldValue"",""type"":""String"",""displayName"":""Old value"",""description"":""Only change the property value if it matches the configured `oldValue`."",""example"":""false""},{""name"":""regex"",""type"":""Boolean"",""displayName"":""Regex"",""description"":""Default false. If enabled, `oldValue` will be interpreted as a Regular Expression, and capture group contents will be available in `newValue`""},{""name"":""relaxedBinding"",""type"":""Boolean"",""displayName"":""Use relaxed binding"",""description"":""Whether to match the `propertyKey` using [relaxed binding](https://docs.spring.io/spring-boot/docs/2.5.6/reference/html/features.html#features.external-config.typesafe-configuration-properties.relaxed-binding) rules. Default is `true`. Set to `false` to use exact matching.""}]", maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.CommentOutSpringPropertyKey,Comment out Spring properties,"Add comment to specified Spring properties, and comment out the property.",1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,"[{""name"":""propertyKey"",""type"":""String"",""displayName"":""Property key"",""description"":""The name of the property key to comment out."",""example"":""management.metrics.binders.files.enabled"",""required"":true},{""name"":""comment"",""type"":""String"",""displayName"":""Comment"",""description"":""Comment to replace the property key."",""example"":""This property is deprecated and no longer applicable starting from Spring Boot 3.0.x"",""required"":true}]", maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.DeleteSpringProperty,Delete a spring configuration property,Delete a spring configuration property from any configuration file that contains a matching key.,1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,"[{""name"":""propertyKey"",""type"":""String"",""displayName"":""Property key"",""description"":""The property key to delete. Supports glob expressions"",""example"":""management.endpoint.configprops.*"",""required"":true}]", maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.ExpandProperties,Expand Spring YAML properties,Expand YAML properties to not use the dot syntax shortcut.,1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,"[{""name"":""sourceFileMask"",""type"":""String"",""displayName"":""Source file mask"",""description"":""An optional source file path mask use to restrict which YAML files will be expanded by this recipe."",""example"":""**/application*.yml""}]", maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.ImplicitWebAnnotationNames,Remove implicit web annotation names,Removes implicit web annotation names.,1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.NoAutowiredOnConstructor,Remove the `@Autowired` annotation on inferred constructor,Spring can infer an autowired constructor when there is a single constructor on the bean. This recipe removes unneeded `@Autowired` annotations on constructors.,1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.NoHttpExchangeAnnotation,Remove `HttpExchange` annotations,"Replace method declaration `@HttpExchange` annotations with `@GetExchange`, `@PostExchange`, etc.",1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.NoRepoAnnotationOnRepoInterface,Remove unnecessary `@Repository` annotation from Spring Data `Repository` sub-interface,Removes superfluous `@Repository` annotation from Spring Data `Repository` sub-interfaces.,1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.NoRequestMappingAnnotation,Remove `@RequestMapping` annotations,"Replace method declaration `@RequestMapping` annotations with `@GetMapping`, `@PostMapping`, etc. when possible.",1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.PropertiesToKebabCaseProperties,Normalize Spring `application*.properties` properties to kebab-case,Normalize Spring `application*.properties` properties to kebab-case.,1,,,,,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, @@ -62,7 +63,7 @@ maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.Me maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MoveAutoConfigurationToImportsFile,Use `AutoConfiguration#imports`,Use `AutoConfiguration#imports` instead of the deprecated entry `EnableAutoConfiguration` in `spring.factories` when defining autoconfiguration classes.,1,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,"[{""name"":""preserveFactoriesFile"",""type"":""Boolean"",""displayName"":""Preserve `spring.factories` files"",""description"":""Don't delete the `spring.factories` for backward compatibility.""}]", maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.SpringBoot2BestPractices,Spring Boot 2.x best practices,Applies best practices to Spring Boot 2 applications.,15,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.SpringBootProperties_2_0,Migrate Spring Boot properties to 2.0,Migrate properties found in `application.properties` and `application.yml`.,563,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_0,Migrate from Spring Boot 1.x to 2.0,"Migrate Spring Boot 1.x applications to the latest Spring Boot 2.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.0.",687,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_0,Migrate from Spring Boot 1.x to 2.0,"Migrate Spring Boot 1.x applications to the latest Spring Boot 2.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.0.",721,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MigrateToWebServerFactoryCustomizer,Use `WebServerFactoryCustomizer`,Use `WebServerFactoryCustomizer` instead of the deprecated `EmbeddedServletContainerCustomizer` in Spring Boot 2.0 or higher. This recipe will replace look for any classes that implement `EmbeddedServletContainerCustomizer` and change the interface to `WebServerFactoryCustomizer`. This recipe also adjusts the types used in the `customize()` method from `*EmbeddedServletContainerFactory` to their `*ServletWebServerFactory` counterparts.,11,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MigrateSpringBootServletInitializerPackageName,Use `org.springframework.boot.web.servlet.support.SpringBootServletInitializer`,Use `org.springframework.boot.web.servlet.support.SpringBootServletInitializer` instead of the deprecated `org.springframework.boot.web.support.SpringBootServletInitializer` in Spring Boot 1.4 or higher.,3,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MigrateHttpMessageConvertersPackageName,Use `org.springframework.boot.autoconfigure.http.HttpMessageConverters`,Use `org.springframework.boot.autoconfigure.http.HttpMessageConverters` instead of the deprecated `org.springframework.boot.autoconfigure.web.HttpMessageConverters` in Spring Boot 2.0 or higher.,3,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, @@ -71,31 +72,31 @@ maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.Mi maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MaybeAddJavaxValidationApi,Add `javax.validation-api` dependency,Conditional on the application using a version of Spring Boot which uses javax but provides a hibernate-validator version which exports the jakarta.validation-api instead.,7,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MaybeAddSpringBootStarterActuator,Replace `micrometer-spring-legacy` with `spring-boot-starter-actuator`,Replace deprecated `micrometer-spring-legacy` with `spring-boot-starter-actuator`.,7,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.SpringBootProperties_2_1,Migrate Spring Boot properties to 2.1,Migrate properties found in `application.properties` and `application.yml`.,115,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_1,Migrate to Spring Boot 2.1,"Migrate applications to the latest Spring Boot 2.1 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.1.",835,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_1,Migrate to Spring Boot 2.1,"Migrate applications to the latest Spring Boot 2.1 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.1.",869,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MigrateRestTemplateBuilderBasicAuthorization,Use `RestTemplateBuilder#basicAuthentication`,`RestTemplateBuilder#basicAuthorization` was deprecated in 2.1.,3,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.SpringBootProperties_2_2,Migrate Spring Boot properties to 2.2,Migrate properties found in `application.properties` and `application.yml`.,85,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_2,Migrate to Spring Boot 2.2,"Migrate applications to the latest Spring Boot 2.2 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.2.",993,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_2,Migrate to Spring Boot 2.2,"Migrate applications to the latest Spring Boot 2.2 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.2.",1027,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MigrateApplicationHealthIndicatorToPingHealthIndicator,Use `PingHealthIndicator`,`org.springframework.boot.actuate.health.ApplicationHealthIndicator` was deprecated in 2.2.,3,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MigrateWebTestClientBuilderCustomizerPackageName,Use `WebTestClientBuilderCustomizer`,`org.springframework.boot.test.autoconfigure.web.reactive.WebTestClientBuilderCustomizer` was deprecated in 2.2.,3,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.SpringBootProperties_2_3,Migrate Spring Boot properties to 2.3,Migrate properties found in `application.properties` and `application.yml`.,175,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_3,Migrate to Spring Boot 2.3,"Migrate applications to the latest Spring Boot 2.3 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.3.",1229,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_3,Migrate to Spring Boot 2.3,"Migrate applications to the latest Spring Boot 2.3 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.3.",1263,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MigrateRestClientBuilderCustomizerPackageName,Use `RestClientBuilderCustomizer`,`org.springframework.boot.autoconfigure.elasticsearch.rest.RestClientBuilderCustomizer` was deprecated in 2.3.,3,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.SpringBootProperties_2_4,Migrate Spring Boot properties to 2.4,Migrate properties found in `application.properties` and `application.yml`.,85,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_4,Migrate to Spring Boot 2.4,"Migrate applications to the latest Spring Boot 2.4 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.4.",1705,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_4,Migrate to Spring Boot 2.4,"Migrate applications to the latest Spring Boot 2.4 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.4.",1799,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MigrateUndertowServletWebServerFactoryIsEagerInitFilters,Use `isEagerFilterInit()`,`org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory#isEagerInitFilters` was deprecated in 2.4 and are removed in 2.6.,3,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MigrateUndertowServletWebServerFactorySetEagerInitFilters,Use `setEagerFilterInit(boolean)`,`org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory#setEagerInitFilters` was deprecated in 2.4 and are removed in 2.6.,3,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.SpringBoot2JUnit4to5Migration,Migrate Spring Boot 2.x projects to JUnit 5 from JUnit 4,This recipe will migrate a Spring Boot application's tests from JUnit 4 to JUnit 5. This spring-specific migration includes conversion of Spring Test runners to Spring Test extensions and awareness of the composable Spring Test annotations.,287,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.SpringBoot2JUnit4to5Migration,Migrate Spring Boot 2.x projects to JUnit 5 from JUnit 4,This recipe will migrate a Spring Boot application's tests from JUnit 4 to JUnit 5. This spring-specific migration includes conversion of Spring Test runners to Spring Test extensions and awareness of the composable Spring Test annotations.,347,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UnnecessarySpringRunWith,Remove unnecessary Spring `@RunWith`,Remove `@RunWith` annotations on Spring tests.,3,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.RemoveObsoleteSpringRunners,Remove obsolete Spring JUnit runners,Remove obsolete classpath runners.,3,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.SpringBootProperties_2_5,Migrate Spring Boot properties to 2.5,Migrate properties found in `application.properties` and `application.yml`.,137,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_5,Upgrade to Spring Boot 2.5,Upgrade to Spring Boot 2.5 from any prior 2.x version.,1923,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_5,Upgrade to Spring Boot 2.5,Upgrade to Spring Boot 2.5 from any prior 2.x version.,2017,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpockToGroovy3,Upgrade Spock to a Groovy 3 compatible variant,Upgrade Spock dependencies to a Groovy 3 compatible 2.0 variant when Groovy 3 is on the classpath.,5,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.DatabaseComponentAndBeanInitializationOrdering,Adds `@DependsOnDatabaseInitialization` to Spring Beans and Components depending on `javax.sql.DataSource`,"Beans of certain well-known types, such as `JdbcTemplate`, will be ordered so that they are initialized after the database has been initialized. If you have a bean that works with the `DataSource` directly, annotate its class or `@Bean` method with `@DependsOnDatabaseInitialization` to ensure that it too is initialized after the database has been initialized. See the [release notes](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-2.5-Release-Notes#initialization-ordering) for more.",5,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.MigrateDatabaseCredentials,Migrate flyway and liquibase credentials,"If you currently define a `spring.flyway.url` or `spring.liquibase.url` you may need to provide additional username and password properties. In earlier versions of Spring Boot, these settings were derived from `spring.datasource` properties but this turned out to be problematic for people that provided their own `DataSource` beans.",9,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.SpringBootProperties_2_6,Migrate Spring Boot properties to 2.6,Migrate properties found in `application.properties` and `application.yml`.,57,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_6,Migrate to Spring Boot 2.6,"Migrate applications to the latest Spring Boot 2.6 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.6.",2169,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_6,Migrate to Spring Boot 2.6,"Migrate applications to the latest Spring Boot 2.6 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.6.",2267,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.SpringBootProperties_2_7,Migrate Spring Boot properties to 2.7,Migrate properties found in `application.properties` and `application.yml`.,25,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7,Migrate to Spring Boot 2.7,Upgrade to Spring Boot 2.7.,2273,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7,Migrate to Spring Boot 2.7,Upgrade to Spring Boot 2.7.,2371,,,,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.search.CustomizingJooqDefaultConfiguration,In Spring Boot 2.5 a `DefaultConfigurationCustomizer` can now be used in favour of defining one or more `*Provider` beans,"To streamline the customization of jOOQ’s `DefaultConfiguration`, a bean that implements `DefaultConfigurationCustomizer` can now be defined. This customizer callback should be used in favour of defining one or more `*Provider` beans, the support for which has now been deprecated. See [Spring Boot 2.5 jOOQ customization](https://docs.spring.io/spring-boot/docs/2.5.x/reference/htmlsingle/#features.sql.jooq.customizing).",1,,,Search,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot2.search.IntegrationSchedulerPoolRecipe,Integration scheduler pool size,"Spring Integration now reuses an available `TaskScheduler` rather 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 the `spring.task.scheduling.pool.size` property.",1,,,Search,Spring Boot 2.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,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. @@ -119,7 +120,7 @@ maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.Re maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.ReplaceRestTemplateBuilderRequestFactoryMethod,Replace `RestTemplateBuilder.requestFactory(Function)` with `requestFactoryBuilder`,"`RestTemplateBuilder.requestFactory(java.util.function.Function)` was deprecated since Spring Boot 3.4, in favor of `requestFactoryBuilder(ClientHttpRequestFactoryBuilder)`.",1,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,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 both `GET /some/greeting` and `GET /some/greeting/`, but it doesn't match `GET /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.",1,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.MigrateHooksToReactorContextProperty,Use `spring.reactor.context-propagation` property,Replace `Hooks.enableAutomaticContextPropagation()` with `spring.reactor.context-propagation=true`.,1,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.SpringBoot33BestPractices,Spring Boot 3.3 best practices,Applies best practices to Spring Boot 3 applications.,7689,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.SpringBoot33BestPractices,Spring Boot 3.3 best practices,Applies best practices to Spring Boot 3 applications.,7811,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.SpringBoot3BestPracticesOnly,Spring Boot 3.3 best practices (only),"Applies best practices to Spring Boot 3 applications, without chaining in upgrades to Spring Boot.",213,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.ReplaceStringLiteralsWithConstants,Replace String literals with Spring constants,Replace String literals with Spring constants where applicable.,193,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.EnableVirtualThreads,Enable Virtual Threads on Java 21,Set `spring.threads.virtual.enabled` to `true` in `application.properties` or `application.yml`.,5,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, @@ -133,7 +134,7 @@ maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.Up maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_2_6,Upgrade MyBatis to Spring Boot 2.6,Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 2.6.,27,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_2_7,Upgrade MyBatis to Spring Boot 2.7,Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 2.7.,31,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.SpringBootProperties_3_0,Migrate Spring Boot properties to 3.0,Migrate properties found in `application.properties` and `application.yml`.,567,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0,Migrate to Spring Boot 3.0,"Migrate applications to the latest Spring Boot 3.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.7.",5801,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0,Migrate to Spring Boot 3.0,"Migrate applications to the latest Spring Boot 3.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 2.7.",5905,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.ActuatorEndpointSanitization,Remove the deprecated properties `additional-keys-to-sanitize` from the `configprops` and `env` end points,Spring Boot 3.0 removed the key-based sanitization mechanism used in Spring Boot 2.x in favor of a unified approach. See https://github.com/openrewrite/rewrite-spring/issues/228.,5,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.MigrateMaxHttpHeaderSize,Rename `server.max-http-header-size` to `server.max-http-request-header-size`,"Previously, the server.max-http-header-size was treated inconsistently across the four supported embedded web servers. When using Jetty, Netty, or Undertow it would configure the max HTTP request header size. When using Tomcat it would configure the max HTTP request and response header sizes. The renamed property is used to configure the http request header size in Spring Boot 3.0. **To limit the max header size of an HTTP response on Tomcat or Jetty (the only two servers that support such a setting), use a `WebServerFactoryCustomizer`**.",3,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.MigrateThymeleafDependencies,Migrate thymeleaf dependencies to Spring Boot 3.x,"Migrate thymeleaf dependencies to the new artifactId, since these are changed with Spring Boot 3.",7,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, @@ -141,19 +142,19 @@ maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.Mi maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.MigrateSapCfJavaLoggingSupport,Migrate SAP cloud foundry logging support to Spring Boot 3.x,"Migrate SAP cloud foundry logging support from `cf-java-logging-support-servlet` to `cf-java-logging-support-servlet-jakarta`, to use Jakarta with Spring Boot 3.",3,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_3_0,Upgrade MyBatis to Spring Boot 3.0,Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 3.0.,35,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.SpringBootProperties_3_1,Migrate Spring Boot properties to 3.1,Migrate properties found in `application.properties` and `application.yml`.,13,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1,Migrate to Spring Boot 3.1,"Migrate applications to the latest Spring Boot 3.1 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 3.0.",6241,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1,Migrate to Spring Boot 3.1,"Migrate applications to the latest Spring Boot 3.1 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 3.0.",6351,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.SpringBootProperties_3_2,Migrate Spring Boot properties to 3.2,Migrate properties found in `application.properties` and `application.yml`.,49,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2,Migrate to Spring Boot 3.2,"Migrate applications to the latest Spring Boot 3.2 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 3.1.",7275,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2,Migrate to Spring Boot 3.2,"Migrate applications to the latest Spring Boot 3.2 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 3.1.",7391,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.RelocateLauncherClasses,Relocate Launcher Classes,Relocate classes that have been moved to different packages in Spring Boot 3.2.,7,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeMyBatisToSpringBoot_3_2,Upgrade MyBatis to Spring Boot 3.2,Upgrade MyBatis Spring modules to a version corresponding to Spring Boot 3.2.,39,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.SpringBootProperties_3_3,Migrate Spring Boot properties to 3.3,Migrate properties found in `application.properties` and `application.yml`.,13,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3,Migrate to Spring Boot 3.3,"Migrate applications to the latest Spring Boot 3.3 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 3.2.",7687,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_3,Migrate to Spring Boot 3.3,"Migrate applications to the latest Spring Boot 3.3 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs, and migrate configuration settings that have changes between versions. This recipe will also chain additional framework migrations (Spring Framework, Spring Data, etc) that are required as part of the migration to Spring Boot 3.2.",7809,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.ChangeCassandraGroupId,Change `com.datastax.oss` to `org.apache.cassandra`,Change `groupId` from `com.datastax.oss` to `org.apache.cassandra` and adopt the Spring Boot 3.3 managed version.,19,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.SpringBootProperties_3_4,Migrate Spring Boot properties to 3.4,Migrate properties found in `application.properties` and `application.yml`.,173,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.SpringBootProperties_3_4_EnabledToAccess,Migrate Enabled to Access Spring Boot Properties,"Migrate properties found in `application.properties` and `application.yml`, specifically converting 'enabled' to 'access'.",157,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_4,Migrate to Spring Boot 3.4,"Migrate applications to the latest Spring Boot 3.4 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs.",8689,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_4,Migrate to Spring Boot 3.4,"Migrate applications to the latest Spring Boot 3.4 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs.",8817,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.SpringBootProperties_3_5,Migrate Spring Boot properties to 3.5,Migrate properties found in `application.properties` and `application.yml`.,59,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_5,Migrate to Spring Boot 3.5,"Migrate applications to the latest Spring Boot 3.5 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs.",8837,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_5,Migrate to Spring Boot 3.5,"Migrate applications to the latest Spring Boot 3.5 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs.",8965,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot3.UpdatePrometheusPushgateway,Update Prometheus Pushgateway Dependency Coordinates,Update the Prometheus Pushgateway artifact ID for Spring Boot 3.5 compatibility.,3,,,,Spring Boot 3.x,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.cloud2022.MigrateRequestMappingOnFeignClient,Migrate `@RequestMapping` on `FeignClient` to `@FeignClient` path attribute,Support for `@RequestMapping` over a `FeignClient` interface was removed in Spring Cloud OpenFeign 2.2.10.RELEASE.,1,,,,Spring Cloud 2022,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.cloud2022.AddLoggingPatternLevelForSleuth,Add logging.pattern.level for traceId and spanId,"Add `logging.pattern.level` for traceId and spanId which was previously set by default, if not already set.",1,,,,Spring Cloud 2022,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, @@ -208,7 +209,7 @@ maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.framewor maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.framework.MigrateSpringAssert,Migrate removed Spring `Assert` methods,Assert methods without a message argument have been removed in Spring Framework 6.0.,25,,,,Spring Framework,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.framework.UpgradeSpringFramework_6_1,Migrate to Spring Framework 6.1,Migrate applications to the latest Spring Framework 6.1 release.,565,,,,Spring Framework,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.framework.UpgradeSpringFramework_6_2,Migrate to Spring Framework 6.2,Migrate applications to the latest Spring Framework 6.2 release.,597,,,,Spring Framework,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.framework.UpgradeSpringFramework_7_0,Migrate to Spring Framework 7.0,Migrate applications to the latest Spring Framework 7.0 release.,965,,,,Spring Framework,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.framework.UpgradeSpringFramework_7_0,Migrate to Spring Framework 7.0,Migrate applications to the latest Spring Framework 7.0 release.,971,,,,Spring Framework,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.http.ReplaceStringLiteralsWithHttpHeadersConstants,Replace String literals with `HttpHeaders` constants,Replace String literals with `org.springframework.http.HttpHeaders` constants.,123,,,,Http,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.http.ReplaceStringLiteralsWithMediaTypeConstants,Replace String literals with `MediaType` constants,Replace String literals with `org.springframework.http.MediaType` constants.,61,,,,Http,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.http.SimplifyMediaTypeParseCalls,Simplify unnecessary `MediaType.parseMediaType()` and `MediaType.valueOf()` calls,Replaces `MediaType.parseMediaType("application/json")` and `MediaType.valueOf("application/json")` with `MediaType.APPLICATION_JSON`.,1,,,,Http,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, @@ -219,7 +220,7 @@ maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.kafka.Ka maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.kafka.RemoveUsingCompletableFuture,Remove `KafkaOperations.usingCompletableFuture()`,Remove the `KafkaOperations.usingCompletableFuture()` bridge during Spring Kafka 2.9 to 3.0 migration.,1,,,,Spring Kafka,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.kafka.UpgradeSpringKafka_3_0,Migrate to Spring Kafka 3.0,Migrate applications to the latest Spring Kafka 3.0 release.,25,,,,Spring Kafka,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.kafka.UpgradeSpringKafka_2_8_ErrorHandlers,Migrates Spring Kafka deprecated error handlers,Migrate error handlers deprecated in Spring Kafka `2.8.x` to their replacements.,7,,,,Spring Kafka,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.kafka.UpgradeSpringKafka_4_0,Migrate to Spring Kafka 4.0,Migrate applications to the latest Spring Kafka 4.0 release.,15,,,,Spring Kafka,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.kafka.UpgradeSpringKafka_4_0,Migrate to Spring Kafka 4.0,Migrate applications to the latest Spring Kafka 4.0 release.,21,,,,Spring Kafka,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.search.FindApiCalls,Find HTTP API calls via `RestTemplate`,Find outbound HTTP API calls made via Spring's `RestTemplate` class.,1,,,,Search,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.java.spring.table.ApiCalls"",""displayName"":""API endpoints"",""description"":""The API endpoints that applications expose."",""columns"":[{""name"":""sourcePath"",""type"":""String"",""displayName"":""Source path"",""description"":""The path to the source file containing the API call.""},{""name"":""method"",""type"":""String"",""displayName"":""Method"",""description"":""The HTTP method of the API endpoint.""},{""name"":""path"",""type"":""String"",""displayName"":""Path"",""description"":""The path of the API endpoint.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.search.FindApiEndpoints,Find Spring API endpoints,"Find all HTTP API endpoints exposed by Spring applications. More specifically, this marks method declarations annotated with `@RequestMapping`, `@GetMapping`, `@PostMapping`, `@PutMapping`, `@DeleteMapping`, and `@PatchMapping` as search results.",1,,,,Search,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.java.spring.table.ApiEndpoints"",""displayName"":""API endpoints"",""description"":""The API endpoints that applications expose."",""columns"":[{""name"":""sourcePath"",""type"":""String"",""displayName"":""Source path"",""description"":""The path to the source file containing the API endpoint definition.""},{""name"":""methodSignature"",""type"":""String"",""displayName"":""Method Signature"",""description"":""The method signature of the API endpoint.""},{""name"":""methodName"",""type"":""String"",""displayName"":""Method name"",""description"":""The name of the method that defines the API endpoint.""},{""name"":""method"",""type"":""String"",""displayName"":""Method"",""description"":""The HTTP method of the API endpoint.""},{""name"":""path"",""type"":""String"",""displayName"":""Path"",""description"":""The path of the API endpoint.""},{""name"":""leadingAnnotations"",""type"":""String"",""displayName"":""Leading Annotations"",""description"":""The Leading annotations of the API endpoint.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.search.FindConfigurationProperties,Find Spring `@ConfigurationProperties`,Find all classes annotated with `@ConfigurationProperties` and extract their prefix values. This is useful for discovering all externalized configuration properties in Spring Boot applications.,1,,,,Search,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.java.spring.table.ConfigurationPropertiesTable"",""displayName"":""Configuration properties"",""description"":""Classes annotated with `@ConfigurationProperties` and their prefix values."",""columns"":[{""name"":""sourcePath"",""type"":""String"",""displayName"":""Source path"",""description"":""The path to the source file containing the @ConfigurationProperties annotation.""},{""name"":""classType"",""type"":""String"",""displayName"":""Class type"",""description"":""The fully qualified name of the class annotated with @ConfigurationProperties.""},{""name"":""prefix"",""type"":""String"",""displayName"":""Prefix"",""description"":""The prefix/value attribute of the @ConfigurationProperties annotation.""}]}]" @@ -265,11 +266,11 @@ maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.test.Spr maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot4.AddAutoConfigureTestRestTemplate,Add `@AutoConfigureTestRestTemplate` if necessary,Adds `@AutoConfigureTestRestTemplate` to test classes annotated with `@SpringBootTest` that use `TestRestTemplate` since this bean is no longer auto-configured as described in the [Spring Boot 4 migration guide](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide#using-webclient-or-testresttemplate-and-springboottest).,1,,,,Boot4,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot4.ReplaceMockBeanAndSpyBean,Replace `@MockBean` and `@SpyBean`,Replaces `@MockBean` and `@SpyBean` annotations with `@MockitoBean` and `@MockitoSpyBean`.,19,,,,Boot4,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot4.MigrateToModularStarters,Migrate to Spring Boot 4.0 modular starters,"Adds the necessary Spring Boot 4.0 starter dependencies based on package usage. Spring Boot 4.0 has a modular design requiring explicit starters for each feature. This recipe detects feature usage via package imports and adds the appropriate starters. -Note: Higher-level starters (like data-jpa) include lower-level ones (like jdbc) transitively, so only the highest-level detected starter is added for each technology.",127,,,,Boot4,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot4.MigrateAutoconfigurePackages,Migrate packages to modular starters,Migrate to new packages used for autoconfiguration by Spring Boot 4.0 modules.,93,,,,Boot4,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, +Note: Higher-level starters (like data-jpa) include lower-level ones (like jdbc) transitively, so only the highest-level detected starter is added for each technology.",129,,,,Boot4,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot4.MigrateAutoconfigurePackages,Migrate packages to modular starters,Migrate to new packages used for autoconfiguration by Spring Boot 4.0 modules.,95,,,,Boot4,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot4.AddSpringBootStarterFlyway,Add `spring-boot-starter-flyway` if using Flyway,Adds the necessary Spring Boot 4.0 Flyway starter for autoconfiguration based on dependency usage.,5,,,,Boot4,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot4.SpringBootProperties_4_0,Migrate Spring Boot properties to 4.0,Migrate properties found in `application.properties` and `application.yml`.,277,,,,Boot4,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0,Migrate to Spring Boot 4.0,"Migrate applications to the latest Spring Boot 4.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs.",11075,,,,Boot4,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.boot4.UpgradeSpringBoot_4_0,Migrate to Spring Boot 4.0,"Migrate applications to the latest Spring Boot 4.0 release. This recipe will modify an application's build files, make changes to deprecated/preferred APIs.",11217,,,,Boot4,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,,"[{""name"":""org.openrewrite.maven.table.MavenMetadataFailures"",""displayName"":""Maven metadata failures"",""description"":""Attempts to resolve maven metadata that failed."",""columns"":[{""name"":""group"",""type"":""String"",""displayName"":""Group id"",""description"":""The groupId of the artifact for which the metadata download failed.""},{""name"":""artifactId"",""type"":""String"",""displayName"":""Artifact id"",""description"":""The artifactId of the artifact for which the metadata download failed.""},{""name"":""version"",""type"":""String"",""displayName"":""Version"",""description"":""The version of the artifact for which the metadata download failed.""},{""name"":""mavenRepositoryUri"",""type"":""String"",""displayName"":""Maven repository"",""description"":""The URL of the Maven repository that the metadata download failed on.""},{""name"":""snapshots"",""type"":""String"",""displayName"":""Snapshots"",""description"":""Does the repository support snapshots.""},{""name"":""releases"",""type"":""String"",""displayName"":""Releases"",""description"":""Does the repository support releases.""},{""name"":""failure"",""type"":""String"",""displayName"":""Failure"",""description"":""The reason the metadata download failed.""}]}]" maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.cloud2023.UpgradeSpringCloud_2023,Migrate to Spring Cloud 2023,Migrate applications to the latest Spring Cloud 2023 (Leyton) release.,21,,,,Spring Cloud 2023,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.cloud2023.DependencyUpgrades,Upgrade dependencies to Spring Cloud 2023,Upgrade dependencies to Spring Cloud 2023 from prior 2022.x version.,19,,,,Spring Cloud 2023,Spring,Java,,,,,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.spring.cloud2024.UpgradeSpringCloud_2024,Migrate to Spring Cloud 2024,Migrate applications to the latest Spring Cloud 2024 (Moorgate) release.,21,,,,Spring Cloud 2024,Spring,Java,,,,Recipes for migrating to Spring Cloud 2024.,Recipes for upgrading and patching [Spring](https://spring.io/) applications.,Basic building blocks for transforming Java code.,, @@ -296,14 +297,14 @@ maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.flyway.AddFlywa maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.flyway.AddFlywayModuleMySQL,Add missing Flyway module for MySQL,"Database modules for Flyway 10 have been split out into separate modules for maintainability. Add the `flyway-mysql` dependency if you are using MySQL with Flyway 10, as detailed on https://github.com/flyway/flyway/issues/3780.",5,,,,,Flyway,Java,,,,,,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.flyway.AddFlywayModuleOracle,Add missing Flyway module for Oracle,"Database modules for Flyway 10 have been split out into separate modules for maintainability. Add the `flyway-database-oracle` dependency if you are using Oracle with Flyway 10, as detailed on https://github.com/flyway/flyway/issues/3780.",5,,,,,Flyway,Java,,,,,,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.flyway.AddFlywayModuleSqlServer,Add missing Flyway module for SQL Server,"Database modules for Flyway 10 have been split out into separate modules for maintainability. Add the `flyway-sqlserver` dependency if you are using SQL Server with Flyway 10, as detailed on https://github.com/flyway/flyway/issues/3780.",5,,,,,Flyway,Java,,,,,,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.SpringFoxToSpringDoc,Migrate from SpringFox Swagger to SpringDoc and OpenAPI,Migrate from SpringFox Swagger to SpringDoc and OpenAPI.,143,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.SwaggerToSpringDoc,Migrate from Swagger to SpringDoc and OpenAPI,Migrate from Swagger to SpringDoc and OpenAPI.,105,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.SpringFoxToSpringDoc,Migrate from SpringFox Swagger to SpringDoc and OpenAPI,Migrate from SpringFox Swagger to SpringDoc and OpenAPI.,147,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.SwaggerToSpringDoc,Migrate from Swagger to SpringDoc and OpenAPI,Migrate from Swagger to SpringDoc and OpenAPI.,109,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.ReplaceSpringFoxDependencies,Replace SpringFox Dependencies,Replace SpringFox Dependencies.,7,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.UpgradeSpringDoc_3_0,Upgrade to SpringDoc 3.0,Upgrade to SpringDoc v3.0.,171,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.UpgradeSpringDoc_2_8,Upgrade to SpringDoc 2.8,Upgrade to SpringDoc v2.8.,167,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.UpgradeSpringDoc_2_6,Upgrade to SpringDoc 2.6,Upgrade to SpringDoc v2.6.,163,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.UpgradeSpringDoc_2_5,Upgrade to SpringDoc 2.5,Upgrade to SpringDoc v2.5.,159,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.UpgradeSpringDoc_2_2,Upgrade to SpringDoc 2.2,Upgrade to SpringDoc v2.2.,155,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, -maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.UpgradeSpringDoc_2,Upgrade to SpringDoc 2.1,"Upgrade to SpringDoc v2.1, as described in the [upgrade guide](https://springdoc.org/#migrating-from-springdoc-v1).",151,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.UpgradeSpringDoc_3_0,Upgrade to SpringDoc 3.0,Upgrade to SpringDoc v3.0.,177,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.UpgradeSpringDoc_2_8,Upgrade to SpringDoc 2.8,Upgrade to SpringDoc v2.8.,173,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.UpgradeSpringDoc_2_6,Upgrade to SpringDoc 2.6,Upgrade to SpringDoc v2.6.,169,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.UpgradeSpringDoc_2_5,Upgrade to SpringDoc 2.5,Upgrade to SpringDoc v2.5.,165,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.UpgradeSpringDoc_2_2,Upgrade to SpringDoc 2.2,Upgrade to SpringDoc v2.2.,161,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, +maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.UpgradeSpringDoc_2,Upgrade to SpringDoc 2.1,"Upgrade to SpringDoc v2.1, as described in the [upgrade guide](https://springdoc.org/#migrating-from-springdoc-v1).",157,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,org.openrewrite.java.springdoc.MigrateSpringdocCommon,Migrate from springdoc-openapi-common to springdoc-openapi-starter-common,Migrate from springdoc-openapi-common to springdoc-openapi-starter-common.,7,,,,,Springdoc,Java,,,,,,Basic building blocks for transforming Java code.,, maven,org.openrewrite.recipe:rewrite-spring,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.,1,,,,,Spring,Maven,,,,,,,"[{""name"":""fromVersion"",""type"":""String"",""displayName"":""From Spring version"",""description"":""XRange pattern for spring version used to limit which projects should be updated"",""example"":"" 2.7.+"",""required"":true},{""name"":""toVersion"",""type"":""String"",""displayName"":""To Spring version"",""description"":""Upgrade version of `org.springframework.boot`"",""example"":""3.0.0-M3"",""required"":true}]", From 16c854e53acad695e6f08dda5d419f4ceb91c110 Mon Sep 17 00:00:00 2001 From: Kang-Jin Kim Date: Sun, 25 Jan 2026 22:19:03 +0900 Subject: [PATCH 5/8] Apply suggestions from code review --- .../org/openrewrite/java/spring/NoHttpExchangeAnnotation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java index e3e3f8e42..9b517e038 100644 --- a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java +++ b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java @@ -17,6 +17,8 @@ import java.util.Optional; +import lombok.Getter; + import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Preconditions; @@ -30,8 +32,6 @@ import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.Space; -import lombok.Getter; - /** * Replace method declaration @HttpExchange annotations with the associated variant * as defined by the request method type (GET, POST, PUT, PATCH, DELETE) From 814758649e81a620442f862b72eaf0d24c8ea125 Mon Sep 17 00:00:00 2001 From: Kang-Jin Kim Date: Sun, 25 Jan 2026 22:25:46 +0900 Subject: [PATCH 6/8] re-order imports --- .../org/openrewrite/java/spring/NoHttpExchangeAnnotation.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java index 9b517e038..427917d4e 100644 --- a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java +++ b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java @@ -15,8 +15,6 @@ */ package org.openrewrite.java.spring; -import java.util.Optional; - import lombok.Getter; import org.jspecify.annotations.Nullable; @@ -32,6 +30,8 @@ import org.openrewrite.java.tree.J; import org.openrewrite.java.tree.Space; +import java.util.Optional; + /** * Replace method declaration @HttpExchange annotations with the associated variant * as defined by the request method type (GET, POST, PUT, PATCH, DELETE) From 7daeb803ca2046ce370f145428868b94ec8835de Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Tue, 27 Jan 2026 14:56:15 +0100 Subject: [PATCH 7/8] Apply formatter --- .../java/spring/NoHttpExchangeAnnotation.java | 197 +++++++++--------- .../spring/NoHttpExchangeAnnotationTest.java | 2 +- 2 files changed, 99 insertions(+), 100 deletions(-) diff --git a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java index 427917d4e..8bcaefaa5 100644 --- a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java +++ b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java @@ -16,7 +16,6 @@ package org.openrewrite.java.spring; import lombok.Getter; - import org.jspecify.annotations.Nullable; import org.openrewrite.ExecutionContext; import org.openrewrite.Preconditions; @@ -47,102 +46,102 @@ public class NoHttpExchangeAnnotation extends Recipe { - @Getter - final String displayName = "Remove `HttpExchange` annotations"; - - @Getter - final String description = "Replace method declaration `@HttpExchange` annotations with `@GetExchange`, `@PostExchange`, etc."; - - @Override - public TreeVisitor getVisitor() { - return Preconditions.check( - new UsesType<>("org.springframework.web.service.annotation.HttpExchange", false), - new NoHttpExchangeAnnotationVisitor()); - } - - private static class NoHttpExchangeAnnotationVisitor extends JavaIsoVisitor { - private static final AnnotationMatcher HTTP_EXCHANGE_ANNOTATION_MATCHER = new AnnotationMatcher("@org.springframework.web.service.annotation.HttpExchange"); - - @Override - public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext ctx) { - J.Annotation a = super.visitAnnotation(annotation, ctx); - if (HTTP_EXCHANGE_ANNOTATION_MATCHER.matches(a) && getCursor().getParentOrThrow().getValue() instanceof J.MethodDeclaration) { - Optional methodArg = findMethodArgument(a); - Optional httpMethod = methodArg.map(this::extractHttpMethod); - String targetAnnotationClassName = httpMethod.map(this::toExchangeAnnotation).orElse(null); - - if (targetAnnotationClassName == null) { - return a; - } - - maybeRemoveImport("org.springframework.web.service.annotation.HttpExchange"); - - if (a.getArguments() != null) { - a = a.withArguments(ListUtils.map(a.getArguments(), arg -> - methodArg.get().equals(arg) ? null : arg)); - } - - maybeAddImport("org.springframework.web.service.annotation." + targetAnnotationClassName); - a = (J.Annotation)new ChangeType( - "org.springframework.web.service.annotation.HttpExchange", - "org.springframework.web.service.annotation." + targetAnnotationClassName, - false - ).getVisitor().visit(a, ctx, getCursor().getParentOrThrow()); - - if (a != null && a.getArguments() != null && a.getArguments().size() == 1) { - a = a.withArguments(ListUtils.map(a.getArguments(), arg -> { - if (arg instanceof J.Assignment && ((J.Assignment)arg).getVariable() instanceof J.Identifier) { - J.Identifier ident = (J.Identifier)((J.Assignment)arg).getVariable(); - if ("value".equals(ident.getSimpleName()) || "url".equals(ident.getSimpleName())) { - return ((J.Assignment)arg).getAssignment().withPrefix(Space.EMPTY); - } - } - return arg; - })); - } - } - return a != null ? a : annotation; - } - - private Optional findMethodArgument(J.Annotation annotation) { - if (annotation.getArguments() == null) { - return Optional.empty(); - } - - return annotation.getArguments().stream() - .filter(arg -> arg instanceof J.Assignment && - ((J.Assignment)arg).getVariable() instanceof J.Identifier && - "method".equals(((J.Identifier)((J.Assignment)arg).getVariable()).getSimpleName())) - .map(J.Assignment.class::cast) - .findFirst(); - } - - private @Nullable String extractHttpMethod(J.@Nullable Assignment assignment) { - if (assignment == null) { - return null; - } - - if (assignment.getAssignment() instanceof J.Literal) { - Object value = ((J.Literal)assignment.getAssignment()).getValue(); - if (value instanceof String) { - return (String)value; - } - } - - return null; - } - - private @Nullable String toExchangeAnnotation(String method) { - switch (method) { - case "GET": - case "POST": - case "PUT": - case "PATCH": - case "DELETE": - return method.charAt(0) + method.toLowerCase().substring(1) + "Exchange"; - default: - return null; - } - } - } + @Getter + final String displayName = "Remove `HttpExchange` annotations"; + + @Getter + final String description = "Replace method declaration `@HttpExchange` annotations with `@GetExchange`, `@PostExchange`, etc."; + + @Override + public TreeVisitor getVisitor() { + return Preconditions.check( + new UsesType<>("org.springframework.web.service.annotation.HttpExchange", false), + new NoHttpExchangeAnnotationVisitor()); + } + + private static class NoHttpExchangeAnnotationVisitor extends JavaIsoVisitor { + private static final AnnotationMatcher HTTP_EXCHANGE_ANNOTATION_MATCHER = new AnnotationMatcher("@org.springframework.web.service.annotation.HttpExchange"); + + @Override + public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext ctx) { + J.Annotation a = super.visitAnnotation(annotation, ctx); + if (HTTP_EXCHANGE_ANNOTATION_MATCHER.matches(a) && getCursor().getParentOrThrow().getValue() instanceof J.MethodDeclaration) { + Optional methodArg = findMethodArgument(a); + Optional httpMethod = methodArg.map(this::extractHttpMethod); + String targetAnnotationClassName = httpMethod.map(this::toExchangeAnnotation).orElse(null); + + if (targetAnnotationClassName == null) { + return a; + } + + maybeRemoveImport("org.springframework.web.service.annotation.HttpExchange"); + + if (a.getArguments() != null) { + a = a.withArguments(ListUtils.map(a.getArguments(), arg -> + methodArg.get().equals(arg) ? null : arg)); + } + + maybeAddImport("org.springframework.web.service.annotation." + targetAnnotationClassName); + a = (J.Annotation) new ChangeType( + "org.springframework.web.service.annotation.HttpExchange", + "org.springframework.web.service.annotation." + targetAnnotationClassName, + false + ).getVisitor().visit(a, ctx, getCursor().getParentOrThrow()); + + if (a != null && a.getArguments() != null && a.getArguments().size() == 1) { + a = a.withArguments(ListUtils.map(a.getArguments(), arg -> { + if (arg instanceof J.Assignment && ((J.Assignment) arg).getVariable() instanceof J.Identifier) { + J.Identifier ident = (J.Identifier) ((J.Assignment) arg).getVariable(); + if ("value".equals(ident.getSimpleName()) || "url".equals(ident.getSimpleName())) { + return ((J.Assignment) arg).getAssignment().withPrefix(Space.EMPTY); + } + } + return arg; + })); + } + } + return a != null ? a : annotation; + } + + private Optional findMethodArgument(J.Annotation annotation) { + if (annotation.getArguments() == null) { + return Optional.empty(); + } + + return annotation.getArguments().stream() + .filter(arg -> arg instanceof J.Assignment && + ((J.Assignment) arg).getVariable() instanceof J.Identifier && + "method".equals(((J.Identifier) ((J.Assignment) arg).getVariable()).getSimpleName())) + .map(J.Assignment.class::cast) + .findFirst(); + } + + private @Nullable String extractHttpMethod(J.@Nullable Assignment assignment) { + if (assignment == null) { + return null; + } + + if (assignment.getAssignment() instanceof J.Literal) { + Object value = ((J.Literal) assignment.getAssignment()).getValue(); + if (value instanceof String) { + return (String) value; + } + } + + return null; + } + + private @Nullable String toExchangeAnnotation(String method) { + switch (method) { + case "GET": + case "POST": + case "PUT": + case "PATCH": + case "DELETE": + return method.charAt(0) + method.toLowerCase().substring(1) + "Exchange"; + default: + return null; + } + } + } } diff --git a/src/test/java/org/openrewrite/java/spring/NoHttpExchangeAnnotationTest.java b/src/test/java/org/openrewrite/java/spring/NoHttpExchangeAnnotationTest.java index 204b4a8b7..b5a8df019 100644 --- a/src/test/java/org/openrewrite/java/spring/NoHttpExchangeAnnotationTest.java +++ b/src/test/java/org/openrewrite/java/spring/NoHttpExchangeAnnotationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2024 the original author or authors. + * Copyright 2026 the original author or authors. *

* Licensed under the Moderne Source Available License (the "License"); * you may not use this file except in compliance with the License. From 208b8b2decc969a5192f576442e9021324df6428 Mon Sep 17 00:00:00 2001 From: Tim te Beek Date: Tue, 27 Jan 2026 15:05:04 +0100 Subject: [PATCH 8/8] Slight polish --- .../java/spring/NoHttpExchangeAnnotation.java | 156 +++++++++--------- 1 file changed, 74 insertions(+), 82 deletions(-) diff --git a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java index 8bcaefaa5..94b142cc6 100644 --- a/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java +++ b/src/main/java/org/openrewrite/java/spring/NoHttpExchangeAnnotation.java @@ -22,6 +22,7 @@ import org.openrewrite.Recipe; import org.openrewrite.TreeVisitor; import org.openrewrite.internal.ListUtils; +import org.openrewrite.internal.StringUtils; import org.openrewrite.java.AnnotationMatcher; import org.openrewrite.java.ChangeType; import org.openrewrite.java.JavaIsoVisitor; @@ -46,6 +47,8 @@ public class NoHttpExchangeAnnotation extends Recipe { + private static final AnnotationMatcher HTTP_EXCHANGE_ANNOTATION_MATCHER = new AnnotationMatcher("@org.springframework.web.service.annotation.HttpExchange"); + @Getter final String displayName = "Remove `HttpExchange` annotations"; @@ -56,92 +59,81 @@ public class NoHttpExchangeAnnotation extends Recipe { public TreeVisitor getVisitor() { return Preconditions.check( new UsesType<>("org.springframework.web.service.annotation.HttpExchange", false), - new NoHttpExchangeAnnotationVisitor()); - } - - private static class NoHttpExchangeAnnotationVisitor extends JavaIsoVisitor { - private static final AnnotationMatcher HTTP_EXCHANGE_ANNOTATION_MATCHER = new AnnotationMatcher("@org.springframework.web.service.annotation.HttpExchange"); - - @Override - public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext ctx) { - J.Annotation a = super.visitAnnotation(annotation, ctx); - if (HTTP_EXCHANGE_ANNOTATION_MATCHER.matches(a) && getCursor().getParentOrThrow().getValue() instanceof J.MethodDeclaration) { - Optional methodArg = findMethodArgument(a); - Optional httpMethod = methodArg.map(this::extractHttpMethod); - String targetAnnotationClassName = httpMethod.map(this::toExchangeAnnotation).orElse(null); - - if (targetAnnotationClassName == null) { - return a; - } - - maybeRemoveImport("org.springframework.web.service.annotation.HttpExchange"); - - if (a.getArguments() != null) { - a = a.withArguments(ListUtils.map(a.getArguments(), arg -> - methodArg.get().equals(arg) ? null : arg)); - } - - maybeAddImport("org.springframework.web.service.annotation." + targetAnnotationClassName); - a = (J.Annotation) new ChangeType( - "org.springframework.web.service.annotation.HttpExchange", - "org.springframework.web.service.annotation." + targetAnnotationClassName, - false - ).getVisitor().visit(a, ctx, getCursor().getParentOrThrow()); + new JavaIsoVisitor() { + @Override + public J.Annotation visitAnnotation(J.Annotation annotation, ExecutionContext ctx) { + J.Annotation a = super.visitAnnotation(annotation, ctx); + if (HTTP_EXCHANGE_ANNOTATION_MATCHER.matches(a) && + getCursor().getParentOrThrow().getValue() instanceof J.MethodDeclaration) { + Optional methodArg = findMethodArgument(a); + String targetAnnotationClassName = methodArg + .map(this::extractHttpMethod) + .map(this::toExchangeAnnotation) + .orElse(null); + if (targetAnnotationClassName == null) { + return a; + } - if (a != null && a.getArguments() != null && a.getArguments().size() == 1) { - a = a.withArguments(ListUtils.map(a.getArguments(), arg -> { - if (arg instanceof J.Assignment && ((J.Assignment) arg).getVariable() instanceof J.Identifier) { - J.Identifier ident = (J.Identifier) ((J.Assignment) arg).getVariable(); - if ("value".equals(ident.getSimpleName()) || "url".equals(ident.getSimpleName())) { - return ((J.Assignment) arg).getAssignment().withPrefix(Space.EMPTY); + maybeRemoveImport("org.springframework.web.service.annotation.HttpExchange"); + maybeAddImport("org.springframework.web.service.annotation." + targetAnnotationClassName); + + a = a.withArguments(ListUtils.filter(a.getArguments(), arg -> !methodArg.get().equals(arg))); + a = (J.Annotation) new ChangeType( + "org.springframework.web.service.annotation.HttpExchange", + "org.springframework.web.service.annotation." + targetAnnotationClassName, + false + ).getVisitor().visit(a, ctx, getCursor().getParentOrThrow()); + + if (a != null && a.getArguments() != null && a.getArguments().size() == 1) { + a = a.withArguments(ListUtils.map(a.getArguments(), arg -> { + if (arg instanceof J.Assignment && ((J.Assignment) arg).getVariable() instanceof J.Identifier) { + J.Identifier ident = (J.Identifier) ((J.Assignment) arg).getVariable(); + if ("value".equals(ident.getSimpleName()) || "url".equals(ident.getSimpleName())) { + return ((J.Assignment) arg).getAssignment().withPrefix(Space.EMPTY); + } + } + return arg; + })); } } - return arg; - })); - } - } - return a != null ? a : annotation; - } + return a != null ? a : annotation; + } - private Optional findMethodArgument(J.Annotation annotation) { - if (annotation.getArguments() == null) { - return Optional.empty(); - } - - return annotation.getArguments().stream() - .filter(arg -> arg instanceof J.Assignment && - ((J.Assignment) arg).getVariable() instanceof J.Identifier && - "method".equals(((J.Identifier) ((J.Assignment) arg).getVariable()).getSimpleName())) - .map(J.Assignment.class::cast) - .findFirst(); - } - - private @Nullable String extractHttpMethod(J.@Nullable Assignment assignment) { - if (assignment == null) { - return null; - } - - if (assignment.getAssignment() instanceof J.Literal) { - Object value = ((J.Literal) assignment.getAssignment()).getValue(); - if (value instanceof String) { - return (String) value; - } - } - - return null; - } + private Optional findMethodArgument(J.Annotation annotation) { + if (annotation.getArguments() == null) { + return Optional.empty(); + } - private @Nullable String toExchangeAnnotation(String method) { - switch (method) { - case "GET": - case "POST": - case "PUT": - case "PATCH": - case "DELETE": - return method.charAt(0) + method.toLowerCase().substring(1) + "Exchange"; - default: - return null; - } - } + return annotation.getArguments().stream() + .filter(arg -> arg instanceof J.Assignment && + ((J.Assignment) arg).getVariable() instanceof J.Identifier && + "method".equals(((J.Identifier) ((J.Assignment) arg).getVariable()).getSimpleName())) + .map(J.Assignment.class::cast) + .findFirst(); + } + + private @Nullable String extractHttpMethod(J.@Nullable Assignment assignment) { + if (assignment != null && assignment.getAssignment() instanceof J.Literal) { + Object value = ((J.Literal) assignment.getAssignment()).getValue(); + if (value instanceof String) { + return (String) value; + } + } + return null; + } + + private @Nullable String toExchangeAnnotation(String method) { + switch (method) { + case "GET": + case "POST": + case "PUT": + case "PATCH": + case "DELETE": + return StringUtils.capitalize(method.toLowerCase()) + "Exchange"; + default: + return null; + } + } + }); } }