Create Spring Boot project using Spring Initialzer

In this post, we will learn to create a Spring Boot project using Spring Initializer. Spring initializer is a simple web page that helps us to generate a spring boot project along with the required structure.

Create Spring Boot Project

Let’s follow the steps given below to create a spring boot project.

  1. Go to https://start.spring.io/ and you will see a page like the one below.
Create a Spring Boot project
  1. You can select a project type whether a Maven or Grade. Here, we will be selecting a Maven project.
  2. You can select a language. The default will be Java
  3. You can select a specific version. It is not recommended to select a SHAPSHOT version. We will be selecting 2.6.2 here.
  4. Group Id: com.codersathi
  5. Artifact Id: hello-world
  6. Name: hello-world
  7. Description: You can give whatever you like. We will be leaving it as default.
  8. Package name: It will be generated automatically based on the Artifact and Group ID
  9. Packaging: You can choose either Jar or War
  10. Java Version: We will be choosing 11
  11. On the right side click Add Dependencies button.
  12. We will be adding web dependency here. You can add other dependencies as per your need.
  13. After adding Web dependency, click on the Generate button.
  14. After clicking the Generate button, it will generate a Zip file in your download location. Unzip it.

Open Spring Boot Project in Eclipse

Now, we have created a Spring Boot project. The project is generated and unzipped. Now, it’s time to open your Eclipse and follow the instructions to open a recently generated project there.

  1. Open your Eclipse IDE.
  2. Go to the File menu and click on Import…
  3. In the Import dialog box, select Maven, expand it, and click on the Existing Maven Projects as shown in the image below.
open existing maven project in eclipse
  1. Click Next button and you will see a window like below.
open maven project in eclipse
  1. Click Browse… button and select a project you have Unzipped earlier and click Finish button.
  2. Your project willbe imported into Eclipse and you may see your project like below
imported maven project in eclipse
  1. Expand your project and you will see a similar kind of structor in your Eclipse. See the image below
Maven based project structure in eclipse

Congratulations! You have successfully generated a spring boot project and imported it into Eclipse.

Conclusion

We followed the steps given above to create a Spring Boot project using spring initializer and open it in eclipse IDE.

Sharing Is Caring:
Subscribe
Notify of
0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments