Important Spring Boot Starters with Examples

In this article, we will discuss important Spring Boot starters with examples.
We can categories Spring boot starters into three categories
  1. Spring Boot application starters
  2. Spring Boot production starters
  3. Spring Boot technical starters

1. Spring Boot application starters

Starters are a set of convenient dependency descriptors that you can include in your application. You get a one-stop shop for all the Spring and related technologies that you need without having to hunt through sample code and copy-paste loads of dependency descriptors. For example

spring-boot-starter-web Starter

While developing the REST service; we can use libraries like Spring MVC, Tomcat and Jackson – a lot of dependencies for a single application.
Spring Boot starters can help to reduce the number of manually added dependencies just by adding one dependency. So instead of manually specifying the dependencies just add one starter as in the following example:
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>

spring-boot-starter-data-jpa Starter

If you want to get started using Spring and JPA for database access, include the spring-boot-starter-data-jpa dependency in your project.
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

spring-boot-starter-test Starter

For testing, we usually use the following set of libraries: Spring Test, JUnit, Hamcrest, and Mockito. We can include all of these libraries manually, but Spring Boot starter can be used to automatically include these libraries in the following way:
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-test</artifactId>
    <scope>test</scope>
</dependency>
Let's list all the important Spring Boot starters with examples.
>> spring-boot-starter-testStarter for testing Spring Boot applications with libraries including JUnit, Hamcrest and Mockito
>> spring-boot-starter-thymeleaf - Starter for building MVC web applications using Thymeleaf views
>> spring-boot-starter-web - Starter for building web, including RESTful, applications using Spring MVC. Uses Tomcat as the default embedded container
>> spring-boot-starter-data-jpa - Starter for using Spring Data JPA with Hibernate
Example for this starter: Spring Boot 2 JPA MySQL CRUD Example
>> spring-boot-starter-activemq - Starter for JMS messaging using Apache ActiveMQ.
Example for this starter available on GitHub spring-boot-sample-activemq
>> spring-boot-starter-amqp - Starter for using Spring AMQP and Rabbit MQ
Example for this starter available on GitHub spring-boot-sample-amqp
>> spring-boot-starter-aopStarter for aspect-oriented programming with Spring AOP and AspectJ
Example for this starter available on GitHub spring-boot-sample-aop
>> spring-boot-starter-batchStarter for using Spring Batch
Example for this starter available on GitHub spring-boot-sample-batch
>> spring-boot-starter-cacheStarter for using Spring Framework’s caching support
Example for this starter available on GitHub spring-boot-sample-cache
>> spring-boot-starter-data-cassandraStarter for using Cassandra distributed database and Spring Data Cassandra
Example for this starter available on GitHub spring-boot-sample-data-cassandra
>> spring-boot-starter-data-couchbaseStarter for using Couchbase document-oriented database and Spring Data Couchbase
Example for this starter available on GitHub spring-boot-sample-data-couchbase
>> spring-boot-starter-data-elasticsearchStarter for using Elasticsearch search and analytics engine and Spring Data Elasticsearch
Example for this starter available on GitHub spring-boot-sample-data-elasticsearch
>> spring-boot-starter-data-ldapStarter for using Spring Data LDAP
Example for this starter available on GitHub spring-boot-sample-data-ldap
>> spring-boot-starter-data-mongodbStarter for using MongoDB document-oriented database and Spring Data MongoDB
Example for this starter available on GitHub spring-boot-sample-data-mongodb
>> spring-boot-starter-data-neo4jStarter for using Neo4j graph database and Spring Data Neo4j
Example for this starter available on GitHub spring-boot-sample-data-neo4j
>> spring-boot-starter-data-redisStarter for using Redis key-value data store with Spring Data Redis and the Lettuce client
Example for this starter available on GitHub spring-boot-sample-data-redis
>> spring-boot-starter-data-restStarter for exposing Spring Data repositories over REST using Spring Data REST
Example for this starter available on GitHub spring-boot-sample-data-rest
>> spring-boot-starter-data-solrStarter for using the Apache Solr search platform with Spring Data Solr
Example for this starter available on GitHub spring-boot-sample-data-solr
>> spring-boot-starter-freemarker - Starter for building MVC web applications using FreeMarker views
Example for this starter available on GitHub spring-boot-sample-web-freemarker
>> spring-boot-starter-hateoasStarter for building hypermedia-based RESTful web application with Spring MVC and Spring HATEOAS
Example for this starter available on GitHub spring-boot-sample-hateoas
>> spring-boot-starter-integrationStarter for using Spring Integration
Example for this starter available on GitHub spring-boot-sample-integration
>> spring-boot-starter-jdbcStarter for using JDBC with the HikariCP connection pool
Example for this starter available on GitHub spring-boot-sample-web-secure-jdbc
>> spring-boot-starter-jerseyStarter for building RESTful web applications using JAX-RS and Jersey. An alternative to spring-boot-starter-web
Example for this starter available on GitHub spring-boot-sample-jersey
>> spring-boot-starter-jooq - Starter for using jOOQ to access SQL databases. An alternative to spring-boot-starter-data-jpa or spring-boot-starter-jdbc
Example for this starter available on GitHub spring-boot-sample-jooq
>> spring-boot-starter-mustacheStarter for building web applications using Mustache views
Example for this starter available on GitHub spring-boot-sample-web-mustache
>> spring-boot-starter-quartzStarter for using the Quartz scheduler 
Example for this starter available on GitHub spring-boot-sample-quartz
>> spring-boot-starter-securityStarter for using Spring Security
Example for this starter: spring-boot-sample-secure
>> spring-boot-starter-web-servicesStarter for using Spring Web Services
Example for this starter available on GitHub spring-boot-sample-webservices
>> spring-boot-starter-webfluxStarter for building WebFlux applications using Spring Framework’s Reactive Web support
Example for this starter available on GitHub spring-boot-sample-secure-webflux
>> spring-boot-starter-websocketStarter for building WebSocket applications using Spring Framework’s WebSocket support
Example for this starter available on GitHub spring-boot-sample-websocket-tomcat
Learn complete Spring Boot on Spring Boot Tutorial

2. Spring Boot production starters 

In addition to the above application starters, the following starters can be used to add production ready features:

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

Finally, Spring Boot also includes the following starters that can be used if you want to exclude or swap specific technical facets:

3. Spring Boot technical starters


Free Spring Boot Tutorial | Full In-depth Course | Learn Spring Boot in 10 Hours


Watch this course on YouTube at Spring Boot Tutorial | Fee 10 Hours Full Course

Comments