Skip to content

Commit 8c9692f

Browse files
committed
Use rewrite release versions. Workaround for xml-bind.
1 parent 3af4bea commit 8c9692f

File tree

5 files changed

+18
-8
lines changed
  • eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs
  • headless-services
  • vscode-extensions/vscode-spring-boot

5 files changed

+18
-8
lines changed

eclipse-language-servers/org.springframework.tooling.boot.ls/src/org/springframework/tooling/boot/ls/prefs/PrefsInitializer.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ public void initializeDefaultPreferences() {
5555
"org.openrewrite.java.spring.boot2.SpringBoot1To2Migration",
5656
"org.openrewrite.java.testing.junit5.JUnit5BestPractices",
5757
"org.openrewrite.java.testing.junit5.JUnit4to5Migration",
58-
"org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_6",
5958
"org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7",
60-
"org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0",
6159
"org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1",
6260
"org.rewrite.java.security.*",
6361
"org.springframework.rewrite.test.*",

headless-services/commons/commons-rewrite/src/main/java/org/springframework/ide/vscode/commons/rewrite/LoadUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public Duration deserialize(JsonElement json, Type type, JsonDeserializationCont
5252
}
5353

5454
public static Recipe createRecipe(RecipeDescriptor d, Function<String, Class<? extends Recipe>> getRecipeClass) {
55-
Class<? extends Recipe> recipeClazz = getRecipeClass.apply(d.getName());
55+
Class<? extends Recipe> recipeClazz = getRecipeClass == null ? null : getRecipeClass.apply(d.getName());
5656
if (recipeClazz == null || DeclarativeRecipe.class.getName().equals(recipeClazz.getName())) {
5757
DeclarativeRecipe recipe = new DeclarativeRecipe(d.getName(), d.getDisplayName(), d.getDescription(),
5858
d.getTags(), d.getEstimatedEffortPerOccurrence(), d.getSource(), false, d.getMaintainers());

headless-services/commons/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,9 @@
113113
<commons-codec-version>1.13</commons-codec-version>
114114

115115
<!-- Rewrite specific properties -->
116-
<rewrite-version>8.1.1</rewrite-version>
117-
<rewrite-spring-version>5.1.0-SNAPSHOT</rewrite-spring-version>
118-
<rewrite-gradle-tooling-api-version>1.1.0-SNAPSHOT</rewrite-gradle-tooling-api-version>
116+
<rewrite-version>8.1.2</rewrite-version>
117+
<rewrite-spring-version>5.0.1</rewrite-spring-version>
118+
<rewrite-gradle-tooling-api-version>1.0.0</rewrite-gradle-tooling-api-version>
119119

120120
<gradle-tooling.version>7.6</gradle-tooling.version>
121121
<gradle-core.version>6.1.1</gradle-core.version>

headless-services/spring-boot-language-server/src/main/java/org/springframework/ide/vscode/boot/java/rewrite/RewriteRecipeRepository.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,15 +188,29 @@ private synchronized void loadRecipes() {
188188
IndefiniteProgressTask progressTask = server.getProgressService().createIndefiniteProgressTask(UUID.randomUUID().toString(), "Loading Rewrite Recipes", null);
189189
try {
190190
log.info("Loading Rewrite Recipes...");
191+
Recipe xmlbindRecipe = null;
191192
StsEnvironment env = createRewriteEnvironment();
192193
for (Recipe r : env.listRecipes()) {
193194
if (r.getName() != null) {
195+
if ("org.openrewrite.java.migrate.jakarta.JavaxXmlBindMigrationToJakartaXmlBind".equals(r.getName())) {
196+
xmlbindRecipe = r;
197+
}
194198
if (recipes.containsKey(r.getName())) {
195199
log.error("Duplicate ids: '" + r.getName() + "'");
196200
}
197201
recipes.put(r.getName(), r);
198202
}
199203
}
204+
// HACK: add Jakarta XML Bind migration recipe again as there are cases when maven dependency isn't added
205+
if (xmlbindRecipe != null) {
206+
for (String id : recipes.keySet()) {
207+
if (id.startsWith("org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_")) {
208+
Recipe recipe = recipes.get(id);
209+
recipe.getDescriptor().getRecipeList().add(xmlbindRecipe.getDescriptor());
210+
recipe.getRecipeList().add(xmlbindRecipe);
211+
}
212+
}
213+
}
200214
codeActionDescriptors.addAll(env.listCodeActionDescriptors());
201215
log.info("Done loading Rewrite Recipes");
202216
} catch (Throwable t) {

vscode-extensions/vscode-spring-boot/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,7 @@
246246
"org.openrewrite.java.spring.boot2.SpringBoot1To2Migration",
247247
"org.openrewrite.java.testing.junit5.JUnit5BestPractices",
248248
"org.openrewrite.java.testing.junit5.JUnit4to5Migration",
249-
"org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_6",
250249
"org.openrewrite.java.spring.boot2.UpgradeSpringBoot_2_7",
251-
"org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_0",
252250
"org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1",
253251
"org.rewrite.java.security.*",
254252
"org.springframework.rewrite.test.*",

0 commit comments

Comments
 (0)