Skip to content

Commit 92b09e8

Browse files
authored
Upgrade spring-shell 3.2.2 (#5722)
This commit updates spring-shell to 3.2.2 and also does the following: * Exclude spring-cloud-dataflow-common-persistence as it caused jdbc stuff in shell and then failures with datasource autoconfig * Temporarily in tests use reflection as some methods in spring-shell are not public anymore. * Add commented out shell log file settings which is a way to log hard shell startup errors
1 parent fdd16c4 commit 92b09e8

File tree

6 files changed

+31
-2
lines changed
  • spring-cloud-dataflow-build/spring-cloud-dataflow-build-dependencies
  • spring-cloud-dataflow-shell/src/main/resources
  • spring-cloud-dataflow-shell-core
  • spring-cloud-skipper

6 files changed

+31
-2
lines changed

spring-cloud-dataflow-build/spring-cloud-dataflow-build-dependencies/pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<!-- Keep spring boot version in sync between spring-cloud-dataflow-build and spring-boot-dependencies (parent and properties) -->
2323
<spring-boot.version>3.2.2</spring-boot.version>
2424
<spring-cloud.version>2023.0.0</spring-cloud.version>
25-
<spring-shell.version>2.1.13</spring-shell.version>
25+
<spring-shell.version>3.2.2</spring-shell.version>
2626
<commons-io.version>2.15.1</commons-io.version>
2727
<commons-text.version>1.11.0</commons-text.version>
2828
<!-- Specific version overrides to deal w/ CVEs -->

spring-cloud-dataflow-shell-core/pom.xml

+10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@
2626
<groupId>org.springframework.cloud</groupId>
2727
<artifactId>spring-cloud-dataflow-rest-client</artifactId>
2828
<version>${project.version}</version>
29+
<exclusions>
30+
<exclusion>
31+
<groupId>org.springframework.boot</groupId>
32+
<artifactId>spring-boot-starter-data-jpa</artifactId>
33+
</exclusion>
34+
<exclusion>
35+
<groupId>org.springframework.cloud</groupId>
36+
<artifactId>spring-cloud-dataflow-common-persistence</artifactId>
37+
</exclusion>
38+
</exclusions>
2939
</dependency>
3040
<dependency>
3141
<groupId>org.springframework.shell</groupId>

spring-cloud-dataflow-shell-core/src/test/java/org/springframework/cloud/dataflow/shell/ShellCommandRunner.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.springframework.shell.Input;
2525
import org.springframework.shell.Shell;
2626
import org.springframework.shell.Utils;
27+
import org.springframework.test.util.ReflectionTestUtils;
2728

2829
import static org.assertj.core.api.Assertions.assertThat;
2930

@@ -62,7 +63,9 @@ public ShellCommandRunner withValidateCommandSuccess() {
6263
public Object executeCommand(String command) {
6364
Parser parser = new DefaultParser();
6465
ParsedLine parsedLine = parser.parse(command, command.length() + 1);
65-
Object rawResult = this.shell.evaluate(new ParsedLineInput(parsedLine));
66+
// TODO: evaluate is not private method in spring-shell so calling it via
67+
// reflection until we refactor to use new shell testing system
68+
Object rawResult = ReflectionTestUtils.invokeMethod(this.shell, "evaluate", new ParsedLineInput(parsedLine));
6669
if (!this.validateCommandSuccess) {
6770
assertThat(rawResult).isNotNull();
6871
assertThat(rawResult).isNotInstanceOf(Exception.class);

spring-cloud-dataflow-shell/src/main/resources/application.yml

+6
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ spring:
66
logging:
77
pattern:
88
console:
9+
# file:
10+
# name: dataflow-shell.log
11+
# level:
12+
# org:
13+
# springframework:
14+
# shell: debug

spring-cloud-skipper/spring-cloud-skipper-shell-commands/pom.xml

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@
4040
<groupId>org.springframework.boot</groupId>
4141
<artifactId>spring-boot-starter-data-jpa</artifactId>
4242
</exclusion>
43+
<exclusion>
44+
<groupId>org.springframework.cloud</groupId>
45+
<artifactId>spring-cloud-dataflow-common-persistence</artifactId>
46+
</exclusion>
4347
</exclusions>
4448
</dependency>
4549
<dependency>

spring-cloud-skipper/spring-cloud-skipper-shell/src/main/resources/application.yml

+6
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ spring:
66
logging:
77
pattern:
88
console:
9+
# file:
10+
# name: skipper-shell.log
11+
# level:
12+
# org:
13+
# springframework:
14+
# shell: debug

0 commit comments

Comments
 (0)