Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我们正在构建一个 spring-shell 应用程序。目前,在交互模式下,我必须像
java -jar sample.jar
外壳:> mycommand arg1 agr2
有没有办法以交互方式运行这个修女,像这样的东西
java -jar sample.jar mycommand arg1 agr2然后退出。
java -jar sample.jar mycommand arg1 agr2
您可以将此自定义运行器添加到您的应用程序中,它会起作用。
https://github.com/spring-projects/spring-shell/blob/c3081d260e7f797f3f2ccd77aedd7decc385d536/spring-shell-samples/src/main/java/org/springframework/shell/samples/ExampleApplicationRunnerConfiguration.java