Javatpoint Logo
Javatpoint Logo

Spring Boot CLI

It is a tool which you can download from the official site of Spring Framework. Here, we are explaining steps.

Download the CLI tool from official site as we are doing here.

Spring Boot cli 1

After downloading, extract the zip file. It contains a bin folder, in which spring setup is stored. We can use it to execute Spring Boot application.

Spring Boot cli 2

CLI executes groovy files. So, first, we need to create a groovy file for Spring Boot application.

Open terminal and cd into the bin location of cli folder.

Spring Boot cli 3

Create a groovy file.

Spring Boot cli 4

Create a controller in the groovy file.

Spring Boot cli 5

Execute this file

By using the following command.

Spring Boot cli 6

After executing the above command, it starts the execution and produces the following output.

Spring Boot cli 7

And after lots of lines. It shows the current status of application as follow.

Spring Boot cli 8

This project is running on the port 8080. So, we can invoke it on any browser by using the following url.

It will produce the following output.

Spring Boot cli 9




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials