A List of Spring Boot Starters

When building RESTful Web Services we often need to add additional functionality to our project. For example, our application might need to work with a database or be able to cache data or work with LDAP or MongoDB. For our application be able to work with LDAP or MongoDB there are third-party libraries which we will need to add to a pom.xml file of our project. Spring Boot simplifies this work for us by providing Spring Boot Starters by adding which we bring in to our project needed libraries. For example, if we needed to create a Spring Boot project with support for RESTful Web Services, there is a starter for that. If we need to add caching support to our project, there is also a starter for that. Or we need to make our Spring Boot application persist data into a database using Spring Data JPA with Hibernate, there is also a started for that.

Each Spring Boot Starter contains a set of libraries which are needed to support the functionality we are adding to our project.

How to Add a Spring Boot Starter to POM.xml

To make our application be able to use Spring Data JPA with Hibernate we will need to add the spring-boot-starter-data-jpa starter to the list of dependencies in the pom.xml file this way:

<dependencies>


<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>


</dependencies>

If we need to write JUnit tests, we will need to add the spring-boot-starter-test Spring Boot Starter to the list of dependencies in our pom.xml file.

 <dependency> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-test</artifactId> 
    <scope>test</scope> 
</dependency>

so if we have 3 starters added to our pom.xml file, the list of dependencies will look like this:

<dependencies>

  <dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
  </dependency>

 
 
 <dependency> 
   <groupId>org.springframework.boot</groupId> 
   <artifactId>spring-boot-starter-data-jpa</artifactId> 
 </dependency>

  <dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-test</artifactId>
   <scope>test</scope>
  </dependency>

 </dependencies>

A List of Spring Boot Starters

Below is a short list of Spring Boot Starters which are commonly used in RESTful Web Service applications. A complete list of starters you will find on Spring Boot documentation page.

A Starter for building web, including RESTful, applications using Spring MVC. Uses Tomcat as the default embedded container:

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-web</artifactId>
</dependency>

 Starter for using Spring Data JPA with Hibernate

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

A Starter for using Spring Security

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-security</artifactId>
</dependency>

Starter for using Tomcat as the embedded servlet container

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>

A Starter for building a hypermedia-based RESTful web application with Spring MVC and Spring HATEOAS

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>

A Starter for testing Spring Boot applications with libraries including JUnit, Hamcrest, and Mockito

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-test</artifactId>
 <scope>test</scope>
</dependency>

A Starter for logging using Logback. Default logging starter

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-logging</artifactId>
</dependency>

Starter for using Log4j2 for logging. An alternative to spring-boot-starter-logging

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>

A Starter for using Spring Boot’s Actuator which provides production-ready features to help you monitor and manage your application

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

A Starter for using Java Bean Validation with Hibernate Validator

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-validation</artifactId>
</dependency>

A Starter for using MongoDB document-oriented database and Spring Data MongoDB

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>

A Starter for using Spring Framework’s caching support

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-cache</artifactId>
</dependency>

A Starter for aspect-oriented programming with Spring AOP and AspectJ

<dependency>
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-aop</artifactId>
</dependency>

I would like to mention it one more time here that the above list of Spring Boot Starters is not complete. A complete list of starters you will find on Spring Boot documentation page.

I hope this tutorial and the above list of starters is of some value to you. If you are interested in free video tutorials on how to build RESTful Web Services with Spring Boot and Spring MVC, please check my Spring Boot and Spring MVC tutorials page. Also, below is a list of video courses which might greatly speed up your learning progress.


Leave a Reply

Your email address will not be published. Required fields are marked *