English 中文(简体)
Spring Boot CLI - Creating Project
  • 时间:2024-09-17

Spring Boot CLI - Creating Project


Previous Page Next Page  

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 apppcation using thymeleaf. Go to E:Test folder and type the following command −


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

The above command will generate the following output −


Using service at https://start.spring.io
Content saved to MavenApppcation.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 GradleApppcation.zip

The above command will generate the following output −


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