Introduction
Spring Boot is an open-source framework. It is based on the Java programming language. Spring Boot is used in creating a microservice. Spring Boot is developed by Pivotal Team. It can be used to build standalone spring applications.
To further enhance your knowledge and gain hands-on experience, you can also consider enrolling in our Spring Boot Course, which covers many of the concepts needed for these interview stages.
In this article, we will be building a simple RESTful web service project.
Steps to Create Project
Step 1: The first thing you need to do is install Spring Tool Suite on your local machine. You can download it from here. After the successful installation, launch Spring Tool Suite.

Step 2: Create a new Spring project by going into File->New->Spring Starter Project, as shown below.

Step 3: Enter the name, group, description, and package of your project, as shown below. After entering the correct details, click on the next button.

Step 4: Choose the correct version of Spring Boot, as shown below. After selecting the correct version, click on the finish button to initialize the project.

Step 5: Look at the project explorer window to observe the project structure as displayed below.

Step 6: Now, we need to add some extra dependencies to the pom.xml file in our project. Add the dependencies Maven repository. Spring Web MVC, Spring Boot DevTools, JPA, and H2 are the dependencies that we need to add to pom.xml. After adding dependencies, your pom.xml will like the following:
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.codingninjas</groupId>
<artifactId>restful_webservice</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>restful_webservice</name>
<description>RESTFUL Webservice</description>
<properties>
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-webmvc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.23</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-devtools -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<version>2.7.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.hibernate.javax.persistence/hibernate-jpa-2.1-api -->
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.2.Final</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.h2database/h2 -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<version>2.1.214</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Step 7: Now open the RestfulWebserviceApplication.java file and run the file as a Java application.
package com.codingninjas.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class RestfulWebserviceApplication {
public static void main(String[] args) {
SpringApplication.run(RestfulWebserviceApplication.class, args);
}
}
By running the above code, no output will be generated. It ensures that the application is running properly.




