该版本仍在开发中,尚未被视为稳定。最新稳定版本请使用Spring Shell 3.4.1spring-doc.cadn.net.cn

背景 详尽

命令执行逻辑通过 Spring Boot 实现应用运行者豆。 通常Spring应用上下文在这些跑道后会自动关闭豆子已被加工,除非有某种东西使其保持活力,比如用途@EnableScheduling或者一般来说,有些线程不会自动死线。spring-doc.cadn.net.cn

可以添加配置属性spring.shell.context.close该登记器为ApplicationListenerApplicationReadyEvent以及请求上下文在 shell 完成执行逻辑后关闭。spring-doc.cadn.net.cn

spring:
  shell:
    context:
      close: true
该设置默认未启用。