Skip to content

Commit a5c8b6e

Browse files
authored
Merge branch 'spring-projects:main' into main
2 parents 2215b1b + 2e8c667 commit a5c8b6e

File tree

16 files changed

+24
-26
lines changed

16 files changed

+24
-26
lines changed

.github/workflows/ci-boot.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
matrix:
1515
os: [ubuntu-latest]
1616
java: [ 17 ]
17-
boot: [ 3.3.6, 3.4.0 ]
17+
boot: [ 3.3.9, 3.4.3 ]
1818
fail-fast: false
1919

2020
steps:

buildSrc/build.gradle

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ dependencies {
3434
implementation("org.springframework:spring-core")
3535
implementation 'org.asciidoctor:asciidoctor-gradle-jvm:3.3.2'
3636
implementation 'org.jfrog.buildinfo:build-info-extractor-gradle:4.29.0'
37+
implementation "org.springframework.boot:org.springframework.boot.gradle.plugin:${springBootVersion}"
3738
}
3839

3940
gradlePlugin {

buildSrc/src/main/java/org/springframework/statemachine/gradle/SamplePlugin.java

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.gradle.api.Project;
2020
import org.gradle.api.plugins.JavaPlugin;
2121
import org.gradle.api.plugins.PluginManager;
22+
import org.springframework.boot.gradle.plugin.SpringBootPlugin;
2223

2324
/**
2425
* @author Janne Valkealahti
@@ -30,6 +31,7 @@ public void apply(Project project) {
3031
PluginManager pluginManager = project.getPluginManager();
3132
pluginManager.apply(JavaPlugin.class);
3233
pluginManager.apply(ManagementConfigurationPlugin.class);
34+
pluginManager.apply(SpringBootPlugin.class);
3335
new JavaConventions().apply(project);
3436
new EclipseConventions().apply(project);
3537
}

spring-statemachine-core/src/main/java/org/springframework/statemachine/config/configuration/StateMachineAnnotationPostProcessorConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class StateMachineAnnotationPostProcessorConfiguration {
3333
private final static String POST_PROCESSOR_BEAN_ID = "org.springframework.statemachine.processor.stateMachineAnnotationPostProcessor";
3434

3535
@Bean(name = POST_PROCESSOR_BEAN_ID)
36-
public StateMachineAnnotationPostProcessor springStateMachineAnnotationPostProcessor() {
36+
public static StateMachineAnnotationPostProcessor springStateMachineAnnotationPostProcessor() {
3737
return new StateMachineAnnotationPostProcessor();
3838
}
3939

spring-statemachine-platform/spring-statemachine-platform.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ description = 'Spring Statemachine BOM'
1010

1111
dependencies {
1212
api platform("org.springframework.boot:spring-boot-dependencies:$springBootVersion")
13+
api platform("org.springframework.shell:spring-shell-dependencies:$springShellVersion")
1314
constraints {
1415
api "com.google.code.findbugs:jsr305:$findbugsVersion"
1516
api "com.esotericsoftware:kryo-shaded:$kryoVersion"
16-
api "org.springframework.shell:spring-shell-core:$springShellVersion"
1717
api "jakarta.persistence:jakarta.persistence-api:$jakartaPersistenceVersion"
1818
api "org.eclipse.uml2:uml:$eclipseUml2UmlVersion"
1919
api "org.eclipse.uml2:types:$eclipseUml2TypesVersion"

spring-statemachine-samples/showcase/spring-statemachine-samples-showcase.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies {
88
management platform(project(":spring-statemachine-platform"))
99
implementation project(':spring-statemachine-samples-common')
1010
implementation project(':spring-statemachine-core')
11-
implementation 'org.springframework.shell:spring-shell-core'
11+
implementation 'org.springframework.shell:spring-shell-starter'
1212
testImplementation(testFixtures(project(':spring-statemachine-core')))
1313
testImplementation (project(':spring-statemachine-test'))
1414
testImplementation 'org.hamcrest:hamcrest-core'

spring-statemachine-samples/showcase/src/main/java/demo/showcase/Application.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
import org.apache.commons.logging.Log;
2121
import org.apache.commons.logging.LogFactory;
2222
import org.springframework.boot.SpringApplication;
23+
import org.springframework.boot.autoconfigure.SpringBootApplication;
2324
import org.springframework.context.annotation.Bean;
2425
import org.springframework.context.annotation.Configuration;
26+
import org.springframework.shell.command.annotation.CommandScan;
2527
import org.springframework.statemachine.StateContext;
2628
import org.springframework.statemachine.action.Action;
2729
import org.springframework.statemachine.config.EnableStateMachine;
@@ -30,7 +32,8 @@
3032
import org.springframework.statemachine.config.builders.StateMachineTransitionConfigurer;
3133
import org.springframework.statemachine.guard.Guard;
3234

33-
@Configuration
35+
@CommandScan
36+
@SpringBootApplication(scanBasePackages = "demo")
3437
public class Application {
3538

3639
private final static Log log = LogFactory.getLog(Application.class);

spring-statemachine-samples/showcase/src/main/java/demo/showcase/StateMachineCommands.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,13 @@
1818
import org.springframework.messaging.support.MessageBuilder;
1919
import org.springframework.shell.command.annotation.Command;
2020
import org.springframework.shell.command.annotation.Option;
21-
import org.springframework.stereotype.Component;
2221

2322
import demo.AbstractStateMachineCommands;
2423
import demo.showcase.Application.Events;
2524
import demo.showcase.Application.States;
2625
import reactor.core.publisher.Mono;
2726

28-
@Component
27+
@Command
2928
public class StateMachineCommands extends AbstractStateMachineCommands<States, Events> {
3029

3130
@Command(command = "sm event", description = "Sends an event to a state machine")

spring-statemachine-samples/showcase/src/main/resources/META-INF/spring/spring-shell-plugin.xml

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
spring.shell.interactive.enabled=true

spring-statemachine-samples/spring-statemachine-samples.gradle

+4
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ dependencies {
1010
implementation 'org.springframework.shell:spring-shell-core'
1111
implementation 'org.springframework.boot:spring-boot-starter'
1212
}
13+
14+
tasks.named("bootJar") {
15+
enabled = false
16+
}

spring-statemachine-samples/turnstile/spring-statemachine-samples-turnstile.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dependencies {
88
management platform(project(":spring-statemachine-platform"))
99
implementation project(':spring-statemachine-samples-common')
1010
implementation project(':spring-statemachine-core')
11-
implementation 'org.springframework.shell:spring-shell-core'
11+
implementation 'org.springframework.shell:spring-shell-starter'
1212
testImplementation(testFixtures(project(':spring-statemachine-core')))
1313
testImplementation (project(':spring-statemachine-test'))
1414
testImplementation 'org.hamcrest:hamcrest-core'

spring-statemachine-samples/turnstile/src/main/java/demo/turnstile/Application.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,16 @@
1818
import java.util.EnumSet;
1919

2020
import org.springframework.boot.SpringApplication;
21+
import org.springframework.boot.autoconfigure.SpringBootApplication;
2122
import org.springframework.context.annotation.Configuration;
23+
import org.springframework.shell.command.annotation.CommandScan;
2224
import org.springframework.statemachine.config.EnableStateMachine;
2325
import org.springframework.statemachine.config.EnumStateMachineConfigurerAdapter;
2426
import org.springframework.statemachine.config.builders.StateMachineStateConfigurer;
2527
import org.springframework.statemachine.config.builders.StateMachineTransitionConfigurer;
2628

27-
@Configuration
29+
@CommandScan
30+
@SpringBootApplication(scanBasePackages = "demo")
2831
public class Application {
2932

3033
//tag::snippetA[]

spring-statemachine-samples/turnstile/src/main/resources/META-INF/spring/spring-shell-plugin.xml

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
spring.shell.interactive.enabled=true

spring-statemachine-samples/turnstile/src/test/java/demo/turnstile/TurnstileTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public void reset(int c1, int c2, int c3, int c4) {
137137
@BeforeEach
138138
public void setup() {
139139
context = new AnnotationConfigApplicationContext();
140-
context.register(CommonConfiguration.class, Application.class, Config.class, StateMachineCommands.class);
140+
context.register(CommonConfiguration.class, Application.class, Config.class);
141141
context.refresh();
142142
machine = context.getBean(StateMachineSystemConstants.DEFAULT_ID_STATEMACHINE, ObjectStateMachine.class);
143143
listener = context.getBean(TestListener.class);

0 commit comments

Comments
 (0)