How to Create a Spring Boot Project?
Spring Boot is built on the top of the spring and contains all the features of spring. And is becoming a favorite of developers these days because of its rapid production-ready environment which enables the developers to directly focus on the logic instead of struggling with the configuration and setup. Spring Boot is a microservice-based framework and making a production-ready application in it takes very little time. Following are some of the features of Spring Boot:
- It allows avoiding heavy configuration of XML which is present in spring
- It provides easy maintenance and creation of REST endpoints
- It includes embedded Tomcat-server
- Deployment is very easy, war and jar files can be easily deployed in the tomcat server
For more information please refer to this article: Introduction to Spring Boot
Generally, to develop a Spring Boot Application we choose Eclipse, Spring Tool Suite, and IntelliJ IDEA IDE. So in this article, we are going to create our spring boot project in these 3 IDEs.
Create a Spring Boot Project in Eclipse IDE
The Eclipse IDE is famous for the Java Integrated Development Environment (IDE), but it has a number of pretty cool IDEs, including the C/C++ IDE, JavaScript/TypeScript IDE, PHP IDE, and more.
Procedure:
- Install Eclipse IDE for Enterprise Java and Web Developer
- Create a Spring Boot Project in Spring Initializr
- Import Spring Boot Project in Eclipse IDE
- Search “maven” and choose Existing Maven Project
- Choose Next
- Click on the Browse button and select the extracted zip
- Click on the Finish button and we are done creating the Spring Boot project
Let us discuss these steps in detail alongside visual aids
Step 1: Install Eclipse IDE for Enterprise Java and Web Developer
Please refer to this article How to Install Eclipse IDE for Enterprise Java and Web Development and install the Eclipse IDE.
Step 2: Create a Spring Boot Project in Spring Initializr
Go to this link and create a Spring Boot project. Please fill in all the details accordingly and at last click on the GENERATE button below. This will download your Spring Boot project in zip format. Now extract the folder into your local machine. For more details in Spring Initializr refer to this article: Spring Initializr
Step 3: Import Spring Boot Project in Eclipse IDE
Go to the Eclipse IDE for Enterprise Java and Web Developer > File > Import as shown in the below image.
Step 4: Search “maven” and choose Existing Maven Project and click on the Next button as shown in the below image.
Step 5: Now click on the Browse button and select the extracted zip file that has been generated.
Step 6. And at last click on the Finish button and we are done creating the Spring Boot project
By now, Spring Boot project has been created as depicted in the below media
Create a Spring Boot Project in STS IDE
Spring Tool Suite (STS) is a java IDE tailored for developing Spring-based enterprise applications. It is easier, faster, and more convenient. And most importantly it is based on Eclipse IDE. STS is free, open-source, and powered by VMware. Spring Tools 4 is the next generation of Spring tooling for the favorite coding environment. Largely rebuilt from scratch, it provides world-class support for developing Spring-based enterprise applications, whether you prefer Eclipse, Visual Studio Code, or Theia IDE.
Procedure:
- Install Spring Tool Suite IDE
- Create a new Spring project
- Fill details in the pop-up window and press Next.
- Choose Spring Boot version and select dependencies and press Next.
- Click on the ‘Finish’ button.
Step 1: Install Spring Tool Suite (Spring Tools 4 for Eclipse) IDE
For this user must have pre-requisite knowledge of downloading and installing Spring Tool Suite IDE
Step 2: Go to the File > New > Spring Starter Project as shown in the below image as follows:
Step 3: In this pop-up window fill the detail below as follows and further click on the Next button as shown in the below image.
Service URL: Default Name: Your Project Name Type: Maven Project Java Version: 11 or greater than 11 Packaging: As your need Language: As your need Group: A unique base name of the company or group that created the project Artifact: A unique name of the project Version: Default Description: As your need Package: Your package name
Step 4: Choose your required Spring Boot Version and select your dependencies as per your project requirement. And at last click on the Next button.
Step 5: Now simply click on the Finish button.
Here now, please wait for some time to download all the required files such as dependencies that you have selected in Step4 above.
Below is the Welcome screen after you have successfully Created and Setup Spring Boot Project in Spring Tool Suite
Create a Spring Boot Project in IntelliJ IDEA
IntelliJ is an integrated development environment(IDE) written in Java. It is used for developing computer software. This IDE is developed by Jetbrains and is available as an Apache 2 Licensed community edition and a commercial edition.
Procedure:
- Install IntelliJ IDEA on the local machine.
- Create a Spring Boot Project in Spring Initializr
- Import Spring Boot Project in IntelliJ IDEA
- Choose the project that you have created in above step 2.
Step 1: Install IntelliJ IDEA on the local machine for that do go through pre-requisite for installing Intellij Idea on the system.
Step 2: Create a Spring Boot Project in Spring Initializr
Create a Spring Boot project and do fill in all the details accordingly and at last click on the GENERATE button below. This will download your Spring Boot project in zip format. Now extract the folder into your local machine and do go through the introduction to Spring Initializr before proceeding further.
Step 3: Import Spring Boot Project in IntelliJ IDEA
After successfully installing IntelliJ IDEA go to the File > Open as seen in the below image.
After this, a pop-up window will occur like the following.
Step 4: Here you have to choose the project that you have created in step 2. For example, here we have created the spring boot project named “demo” and stored it inside the Downloads folder and you can see we can find the same inside the Downloads folder. At last click on the OK button. And we are done creating the Spring Boot project in IntelliJ IDEA. Please wait for some time to download all the required files.
By now, the Spring Boot project has been created as depicted in the below media. The left side contains the Project file structure while in the middle you can see the Code Editor is present.
Contact Us