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

上下文关闭

命令执行逻辑通过 Spring Boot 的ApplicationRunner豆。 通常为弹簧ApplicationContext在这些运行程序之后自动关闭 beans 已经被处理过,除非有东西让它保持活力,比如 用途@EnableScheduling或者一般来说,有一些线程 不会自动死亡。spring-doc.cadn.net.cn

可以添加配置属性spring.shell.context.close哪些注册ApplicationListenerApplicationReadyEvent和请求 shell 完成其执行逻辑后 context close。spring-doc.cadn.net.cn

spring:
  shell:
    context:
      close: true
默认情况下,此设置未启用。