In this tutorial, you will learn how to create a new Spring Boot project using Spring Initializr tool.
What is String Initializr?
Spring Initializr is a tool that helps you easily generate a new Spring Boot project and download it in a ZIP file. You can then open the created project in any Java development environment of your choice. To start creating a new Spring Boot project using Spring Initilizr tool, you will need to open the following URL in the browser window: https://start.spring.io.
Creating a New Project
To create a new Spring Boot project using Spring Initializr tool, open the following URL in the browser window https://start.spring.io. This URL should load a page that will look similar to the image below:
To create a new Maven-based project, select Maven Project. If you are going to use Java, then select Java as your programming language. Spring Initializr tool will offer you to select one of the latest versions of Spring Boot project. In this particular example, I will select Spring Boot version 2.7.0.
Project Metadata is a section where we provide maven coordinates, packaging and version of Java that we are going to use for this Spring Boot project.
- Group – is very similar to a root package name of your project. For example, I am building a RESTful Web Service API for my project, so the package name for my project will be: com.appsdeveloperblog.ws.api,
- Artifact – is very similar to a project name. As a value here I will provide UsersService,
- Name – is a project name. As a value here I will provide UsersService,
- Description – is a short description of your project,
- Package name – is a root package name of your project,
- Packaging – Once we build our project it can be packaged into a Jar or War archive. If you are going to deploy this application as a web application to Apache Tomcat, then as a package, you will select War. Otherwise, in most of the cases you will package your application as a Jar file.
Now it is time to provide project dependencies.
The list of dependencies you will add here will depend on the project functionality that you will need to implement. If you are working on a Web Service application, then one of the dependencies that you will add is Spring Web dependency.
Once you add the needed dependencies, click on Generate button to download this project as ZIP archive to your computer. Unzip downloaded project and open it in your favourite Java development environment.
If you like learning Java by watching video tutorials, then here is a short video tutorial that demonstrates how to create a new Spring Boot project using Spring Initializr tool. If you like it, then there many other Spring Boot REST as well as Spring Boot MVC video tutorials that I have for you here on my blog.