diff --git a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/PrefsInitializer.java b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/PrefsInitializer.java index 41139918a..d28ad418b 100644 --- a/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/PrefsInitializer.java +++ b/eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/PrefsInitializer.java @@ -55,9 +55,7 @@ public class PrefsInitializer extends AbstractPreferenceInitializer { "org.openrewrite.java.spring.boot2.SpringBoot1To2Migration", "org.openrewrite.java.testing.junit5.JUnit5BestPractices", "org.openrewrite.java.testing.junit5.JUnit4to5Migration", - "org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_6", "org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7", - "org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0", "org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1", "org.rewrite.java.security.*", "org.springframework.rewrite.test.*", diff --git a/headless-services/commons/commons-rewrite/src/main/java/org/springframework/ide/vscode/commons/rewrite/LoadUtils.java b/headless-services/commons/commons-rewrite/src/main/java/org/springframework/ide/vscode/commons/rewrite/LoadUtils.java index db6de870c..b07f0d6d4 100644 --- a/headless-services/commons/commons-rewrite/src/main/java/org/springframework/ide/vscode/commons/rewrite/LoadUtils.java +++ b/headless-services/commons/commons-rewrite/src/main/java/org/springframework/ide/vscode/commons/rewrite/LoadUtils.java @@ -52,7 +52,7 @@ public class LoadUtils { } public static Recipe createRecipe(RecipeDescriptor d, Function> getRecipeClass) { - Class recipeClazz = getRecipeClass.apply(d.getName()); + Class recipeClazz = getRecipeClass == null ? null : getRecipeClass.apply(d.getName()); if (recipeClazz == null || DeclarativeRecipe.class.getName().equals(recipeClazz.getName())) { DeclarativeRecipe recipe = new DeclarativeRecipe(d.getName(), d.getDisplayName(), d.getDescription(), d.getTags(), d.getEstimatedEffortPerOccurrence(), d.getSource(), false, d.getMaintainers()); diff --git a/headless-services/commons/pom.xml b/headless-services/commons/pom.xml index c8452b4a2..b82145a03 100644 --- a/headless-services/commons/pom.xml +++ b/headless-services/commons/pom.xml @@ -113,9 +113,9 @@ 1.13 - 8.1.1 - 5.1.0-SNAPSHOT - 1.1.0-SNAPSHOT + 8.1.2 + 5.0.1 + 1.0.0 7.6 6.1.1 diff --git a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/RewriteRecipeRepository.java b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/RewriteRecipeRepository.java index 482777ca3..af5bc3c53 100644 --- a/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/RewriteRecipeRepository.java +++ b/headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/RewriteRecipeRepository.java @@ -188,15 +188,29 @@ public class RewriteRecipeRepository implements ApplicationContextAware { IndefiniteProgressTask progressTask = server.getProgressService().createIndefiniteProgressTask(UUID.randomUUID().toString(), "Loading Rewrite Recipes", null); try { log.info("Loading Rewrite Recipes..."); + Recipe xmlbindRecipe = null; StsEnvironment env = createRewriteEnvironment(); for (Recipe r : env.listRecipes()) { if (r.getName() != null) { + if ("org.openrewrite.java.migrate.jakarta.JavaxXmlBindMigrationToJakartaXmlBind".equals(r.getName())) { + xmlbindRecipe = r; + } if (recipes.containsKey(r.getName())) { log.error("Duplicate ids: '" + r.getName() + "'"); } recipes.put(r.getName(), r); } } + // HACK: add Jakarta XML Bind migration recipe again as there are cases when maven dependency isn't added + if (xmlbindRecipe != null) { + for (String id : recipes.keySet()) { + if (id.startsWith("org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_")) { + Recipe recipe = recipes.get(id); + recipe.getDescriptor().getRecipeList().add(xmlbindRecipe.getDescriptor()); + recipe.getRecipeList().add(xmlbindRecipe); + } + } + } codeActionDescriptors.addAll(env.listCodeActionDescriptors()); log.info("Done loading Rewrite Recipes"); } catch (Throwable t) { diff --git a/vscode-extensions/vscode-spring-boot/package.json b/vscode-extensions/vscode-spring-boot/package.json index 40c9a7d9a..0b52a547e 100644 --- a/vscode-extensions/vscode-spring-boot/package.json +++ b/vscode-extensions/vscode-spring-boot/package.json @@ -246,9 +246,7 @@ "org.openrewrite.java.spring.boot2.SpringBoot1To2Migration", "org.openrewrite.java.testing.junit5.JUnit5BestPractices", "org.openrewrite.java.testing.junit5.JUnit4to5Migration", - "org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_6", "org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7", - "org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0", "org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1", "org.rewrite.java.security.*", "org.springframework.rewrite.test.*",