Spring Boot provides us with several ways to create a new project using Spring Initializr, but the easiest way that many programmers always use that is the Spring Initializr Web. In this tutorial, I will guide you all on how to create a new Spring Boot project using Spring Initializr Web.
First, you need to know the URL of the Spring Initializr Web which is:
Its interface is as follows:
As you can see, the first information, 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 3.0.1 (maybe the version will be different for you).
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.
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.
The right side of this page allows us to add dependencies to our project. Please click the Add button, the following window will appear:
The easiest way is to enter the dependency name in this box, a list of dependencies that may be suitable for you will be displayed.
For example, if 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.
Finally, when you are satisfied with the information about the project and dependencies that you want to use, click the Generate button to Spring Initializr Web to 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: