Spring Boot CLI - Using Shell


Advertisements


Spring Boot CLI provides a Shell interface to run the commands in which we can directly run the commands as shown below. Go to E:\Test folder and type the following command −

E:/Test> spring shell

The above command will generate the following output −

?[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

In this section, we will learn how to run commands in Shell. Type the following and see the output −

version
Spring CLI v1.5.8.RELEASE

You can press tab to auto complete the commands and type exit to finish the shell console.

Testing the application in shell

Let us now learn how to test the application in shell. Type the following line of code and see the output −

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>


Advertisements