2

我们正在构建一个 spring-shell 应用程序。目前,在交互模式下,我必须像

java -jar sample.jar 

外壳:> mycommand arg1 agr2

有没有办法以交互方式运行这个修女,像这样的东西

java -jar sample.jar mycommand arg1 agr2然后退出。

4

1 回答 1

0

您可以将此自定义运行器添加到您的应用程序中,它会起作用。

https://github.com/spring-projects/spring-shell/blob/c3081d260e7f797f3f2ccd77aedd7decc385d536/spring-shell-samples/src/main/java/org/springframework/shell/samples/ExampleApplicationRunnerConfiguration.java

于 2021-02-13T09:12:31.283 回答