Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 921ddef

Browse files
authored
Remove boot upgrade command
1 parent 4c41df0 commit 921ddef

File tree

5 files changed

+3
-99
lines changed

5 files changed

+3
-99
lines changed

build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ ext {
5151
set('kohsukeVersion', '1.301')
5252
set('gitlab4jVersion', '4.19.0')
5353
set('openrewriteVersion', '8.13.4')
54-
set('springRewriteCommonsVersion', '0.1.0-SNAPSHOT')
5554
set('antVersion', '1.10.9')
5655
set('mavenModelVersion', '3.5.4')
5756
set('tikaVersion', '1.18')
@@ -94,8 +93,6 @@ dependencies {
9493
implementation 'org.glassfish.jaxb:jaxb-runtime'
9594
implementation 'com.theokanning.openai-gpt3-java:service'
9695
implementation 'org.commonmark:commonmark'
97-
implementation 'org.springframework.rewrite:spring-rewrite-commons-starter-boot-upgrade'
98-
implementation 'org.springframework.rewrite:spring-rewrite-commons-launcher'
9996

10097
testImplementation 'org.openrewrite:rewrite-test'
10198
testImplementation 'uk.org.webcompere:system-stubs-jupiter'
@@ -115,7 +112,6 @@ dependencyManagement {
115112
dependency "org.rauschig:jarchivelib:${jarchivelibVersion}"
116113
dependency "org.kohsuke:github-api:${kohsukeVersion}"
117114
dependency "org.gitlab4j:gitlab4j-api:${gitlab4jVersion}"
118-
dependency "org.springframework.rewrite:spring-rewrite-commons-starter-boot-upgrade:${springRewriteCommonsVersion}"
119115
dependency "org.openrewrite:rewrite-test:${openrewriteVersion}"
120116
dependency "org.openrewrite:rewrite-java-17:${openrewriteVersion}"
121117
dependency "org.openrewrite:rewrite-xml:${openrewriteVersion}"

src/main/java/org/springframework/cli/command/BootCommands.java

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,12 @@
1616

1717
package org.springframework.cli.command;
1818

19-
import org.jline.utils.AttributedStringBuilder;
20-
import org.jline.utils.AttributedStyle;
21-
2219
import org.springframework.beans.factory.annotation.Autowired;
2320
import org.springframework.cli.config.SpringCliUserConfig;
2421
import org.springframework.cli.git.SourceRepositoryService;
2522
import org.springframework.cli.merger.ProjectHandler;
2623
import org.springframework.cli.util.ProjectInfo;
2724
import org.springframework.cli.util.TerminalMessage;
28-
import org.springframework.rewrite.RewriteRecipeLauncher;
2925
import org.springframework.shell.command.annotation.Command;
3026
import org.springframework.shell.command.annotation.Option;
3127

@@ -38,15 +34,12 @@ public class BootCommands extends AbstractSpringCliCommands {
3834

3935
private final TerminalMessage terminalMessage;
4036

41-
private final RewriteRecipeLauncher rewriteRecipeLauncher;
42-
4337
@Autowired
4438
public BootCommands(SpringCliUserConfig springCliUserConfig, SourceRepositoryService sourceRepositoryService,
45-
TerminalMessage terminalMessage, RewriteRecipeLauncher rewriteRecipeLauncher) {
39+
TerminalMessage terminalMessage) {
4640
this.springCliUserConfig = springCliUserConfig;
4741
this.sourceRepositoryService = sourceRepositoryService;
4842
this.terminalMessage = terminalMessage;
49-
this.rewriteRecipeLauncher = rewriteRecipeLauncher;
5043
}
5144

5245
@Command(command = "new", description = "Create a new Spring Boot project from an existing project.")
@@ -71,15 +64,4 @@ public void bootAdd(@Option(
7164
handler.add(from, path);
7265
}
7366

74-
@Command(command = "upgrade", description = "Apply a set of automated migrations to upgrade a Boot application.")
75-
public void bootUpgrade(@Option(description = "Path") String path) {
76-
rewriteRecipeLauncher.run("org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_1", path,
77-
(progressMessage) -> {
78-
AttributedStringBuilder sb = new AttributedStringBuilder();
79-
sb.style(sb.style().foreground(AttributedStyle.WHITE));
80-
sb.append(progressMessage);
81-
terminalMessage.print(sb.toAttributedString());
82-
});
83-
}
84-
8567
}

src/main/java/org/springframework/cli/config/SpringCliConfiguration.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,7 @@
3535
import org.springframework.cli.util.TerminalMessage;
3636
import org.springframework.context.annotation.Bean;
3737
import org.springframework.context.annotation.Configuration;
38-
import org.springframework.context.annotation.Import;
3938
import org.springframework.http.client.reactive.ReactorResourceFactory;
40-
import org.springframework.rewrite.boot.autoconfigure.RewriteLauncherConfiguration;
4139
import org.springframework.shell.command.CommandExceptionResolver;
4240
import org.springframework.shell.command.CommandRegistration;
4341
import org.springframework.shell.result.CommandNotFoundMessageProvider;
@@ -51,7 +49,6 @@
5149
*/
5250
@Configuration(proxyBeanMethods = false)
5351
@EnableConfigurationProperties({ SpringCliProperties.class, SpringCliProjectCatalogProperties.class })
54-
@Import(RewriteLauncherConfiguration.class) // required for boot upgrade command
5552
public class SpringCliConfiguration {
5653

5754
@Bean

src/test/java/org/springframework/cli/command/BootCommands2Tests.java

Lines changed: 0 additions & 67 deletions
This file was deleted.

src/test/java/org/springframework/cli/support/MockConfigurations.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,11 @@
4343
import org.springframework.cli.util.TerminalMessage;
4444
import org.springframework.context.annotation.Bean;
4545
import org.springframework.context.annotation.Configuration;
46-
import org.springframework.context.annotation.Import;
47-
import org.springframework.rewrite.RewriteRecipeLauncher;
48-
import org.springframework.rewrite.boot.autoconfigure.RewriteLauncherConfiguration;
4946
import org.springframework.shell.style.ThemeResolver;
5047

5148
public class MockConfigurations {
5249

5350
@Configuration
54-
@Import(RewriteLauncherConfiguration.class) // required for boot upgrade command
5551
public static class MockBaseConfig {
5652

5753
@Bean
@@ -78,9 +74,9 @@ SpecialCommands specialCommands() {
7874

7975
@Bean
8076
BootCommands bootCommands(SpringCliUserConfig springCliUserConfig,
81-
SourceRepositoryService sourceRepositoryService, RewriteRecipeLauncher rewriteRecipeLauncher) {
77+
SourceRepositoryService sourceRepositoryService) {
8278
BootCommands bootCommands = new BootCommands(springCliUserConfig, sourceRepositoryService,
83-
TerminalMessage.noop(), rewriteRecipeLauncher);
79+
TerminalMessage.noop());
8480
return bootCommands;
8581
}
8682

0 commit comments

Comments
 (0)