Spring Boot provides us several ways to create a new project using Spring Initializr, but the easiest way that many programmers alway use that is the Spring Initializr Web. In this tutorial, I will guide you all how to create new Spring Boot project using Spring Initializr Web.
First, you need to know the URL of the Spring Initializr Web that is:
Its interface is as follows:
As you can see, the first three lines, we need to choose, are: which kind of project you want to create, a new Maven project or Gradle project, the programming language Java, Kotlin or Groovy, and which version of Spring Boot you want to use.
Here, I will create a new Maven project, use the Java language and use the latest version of Spring Boot 2.1.3 (maybe the version will be different for you), so I only change the version of Spring Boot, the rest will be as default.
Below, the Project Metadata section is a number of fields that help you fill out some of your project information. At the very least, we must enter Group Id and Artifact Id for our project. I will enter Group Id as com.huongdanjava and Artifact Id as spring-boot-example.
If you click on the link More options:
then we can also edit some more information such as Name, Description, Package Name, etc. This information is used to generate Maven or Gradle project.
I will leave them as default values.
At the bottom, you will see a line that lets us add dependencies to our project. The easiest way is: enter dependency names in this box, a list of dependencies that may be appropriate for you, will display.
For example, I want to add JPA dependency to my project, I will enter JPA. The results will be as follows:
Select the dependency you want to use.
Result:
Finally, when you are satisfied with the information about the project and dependencies that you want to use, click the Generate Project button to Spring Initializr Web generate a project for us as a zip file. It will take our project name to name this zip file.
In this example, my zip file name is spring-boot-example.zip.
Unzip this zip file and open it in Spring Tool Suite with Maven project, you will see the following result: