Skip to content

DevTools AutoReload Support #1224

@jamesward

Description

@jamesward

I'd like to use Spring Shell with Spring DevTools for auto-reload. (Relates to some Embabel issues I've encountered: embabel/embabel-agent#1133)

Currently a basic application gets into a wonky state after reload (https://github.com/jamesward/hello-spring-shell/tree/devtools)

./gradlew bootRun
> Task :checkKotlinGradlePluginConfigurationErrors SKIPPED
> Task :compileKotlin UP-TO-DATE
> Task :compileJava NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE
> Task :resolveMainClassName

> Task :bootRun

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v4.0.0)

2025-12-12T11:42:56.008-07:00  INFO 67950 --- [  restartedMain] com.example.demo.DemoApplicationKt       : Starting DemoApplicationKt using Java 21.0.9 with PID 67950 (/home/jw/projects/hello/hello-spring-shell/build/classes/kotlin/main started by jw in /home/jw/projects/hello/hello-spring-shell)
2025-12-12T11:42:56.010-07:00  INFO 67950 --- [  restartedMain] com.example.demo.DemoApplicationKt       : No active profile set, falling back to 1 default profile: "default"
2025-12-12T11:42:56.042-07:00  INFO 67950 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2025-12-12T11:42:56.372-07:00  WARN 67950 --- [  restartedMain] org.jline                                : Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
2025-12-12T11:42:56.438-07:00  INFO 67950 --- [  restartedMain] com.example.demo.DemoApplicationKt       : Started DemoApplicationKt in 0.638 seconds (process running for 0.842)
shell:>hello
hello, world!!!
shell:>2025-12-12T11:43:40.752-07:00  INFO 67950 --- [   File Watcher] rtingClassPathChangeChangedEventListener : Restarting due to 3 class path changes (0 additions, 0 deletions, 3 modifications)

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v4.0.0)

2025-12-12T11:43:40.796-07:00  INFO 67950 --- [  restartedMain] com.example.demo.DemoApplicationKt       : Starting DemoApplicationKt using Java 21.0.9 with PID 67950 (/home/jw/projects/hello/hello-spring-shell/build/classes/kotlin/main started by jw in /home/jw/projects/hello/hello-spring-shell)
2025-12-12T11:43:40.797-07:00  INFO 67950 --- [  restartedMain] com.example.demo.DemoApplicationKt       : No active profile set, falling back to 1 default profile: "default"
2025-12-12T11:43:40.867-07:00  WARN 67950 --- [  restartedMain] org.jline                                : Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)
2025-12-12T11:43:40.877-07:00  INFO 67950 --- [  restartedMain] com.example.demo.DemoApplicationKt       : Started DemoApplicationKt in 0.092 seconds (process running for 45.282)
shell:>hello
Command hl not found
Available commands: 

	hello: say hello
Built-In Commands
	help: Display help about available commands
	version: Show version info
	clear: Clear the terminal screen

shell:>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions