Spring Boot CLI - 使用Shell

Spring Boot CLI提供了一个Shell接口来运行命令,我们可以在其中直接运行命令,如下所示.转到 E:\ Test 文件夹并输入以下命令 :

E:/Test> spring shell

上面的命令将生成以下输出 :

?[1mSpring Boot?[m?[2m (v1.5.8.RELEASE)?[m
Hit TAB to complete. Type 'help' and hit RETURN for help, and 'exit' to quit.

在Shell中运行命令

在本节中,我们将学习如何在Shell中运行命令.输入以下内容并查看输出 :

version
Spring CLI v1.5.8.RELEASE

您可以按Tab键自动完成命令并输入exit以完成shell控制台.

在shell中测试应用程序

现在让我们学习如何在shell中测试应用程序.输入以下代码行并查看输出 :

E:\Test\FirstApplication>spring shell
?[1mSpring Boot?[m?[2m (v1.5.8.RELEASE)?[m
Hit TAB to complete. Type 'help' and hit RETURN for help, and 'exit' to quit.
$ test FirstApplication.groovy TestFirstApplication.groovy
.
Time: 0.347

OK (1 test)

$ exit
E:\Test\FirstApplication>