English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
It is a tool that can be downloaded from the official site of the Spring Framework. Here, we explain the steps.
As we did here, download the CLI tool from the official site.
After downloading, unzip the zip file. It contains a bin folder used to store spring settings. We can use it to execute Spring Boot applications.
CLI executes groovy files. Therefore, first, we need to create a Groovy file for the Spring Boot application.
Open the terminal and then insert cd into the bin location of the cli folder.
Create a regular file.
Create a controller in the groovy file.
Execute this file
By using the following command.
./spring run SpringBootCliExample.groovy
After executing the above command, it starts executing and produces the following output.
and after many lines.
This project is running on port8080. Therefore, we can use the following URL to call it in any browser.
localhost:8080:/cli-example
It will produce the following output.