Spring Boot CLI - Creating Project



Spring Boot CLI can be used to create a new project with maven as default build tool using init command. Maven will use https://start.spring.io service. In the following example, we will create a web application using thymeleaf. Go to E:\Test folder and type the following command −

E:/Test> spring init --dependencies = web,thymeleaf MavenApplication.zip

The above command will generate the following output −

Using service at https://start.spring.io
Content saved to MavenApplication.zip

Create Gradle project

We can create a Gradle based project as well by setting --build as gradle. To understand this in a better way, consider the example given below. Go to E:\Test folder and type the following command −

E:/Test> spring init --build = gradle 
--java-version = 1.8 --dependencies = web,thymeleaf 
--packaging = war GradleApplication.zip

The above command will generate the following output −

Using service at https://start.spring.io
Content saved to GradleApplication.zip
Advertisements