Spring Boot CLI - Creating Project


Advertisements


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 following example we'll 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

You will see 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. See the below example. 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

You will see the following output −

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


Advertisements
E-Books Store