目录

Spring Boot CLI - Using 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.

Running commands in 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>
↑回到顶部↑
WIKI教程 @2018