In this article, we will discuss important Spring Boot starters with examples.
We can categories Spring boot starters into three categories
We can categories Spring boot starters into three categories
- Spring Boot application starters
- Spring Boot production starters
- 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 examplespring-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-test - Starter for testing Spring Boot applications with libraries including JUnit, Hamcrest and Mockito
Example for this starter: Spring Boot 2 REST APIs Integration Testing
>> spring-boot-starter-thymeleaf - Starter for building MVC web applications using Thymeleaf views
Example for this starter:Spring Boot 2 MVC Web Application Thymeleaf JPA MySQL Example
>> spring-boot-starter-web - Starter for building web, including RESTful, applications using Spring MVC. Uses Tomcat as the default embedded container
Example for this starter: Spring Boot 2 Hibernate 5 MySQL CRUD REST API Tutorial
>> 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-aop - Starter for aspect-oriented programming with Spring AOP and AspectJ
Example for this starter available on GitHub spring-boot-sample-aop
>> spring-boot-starter-batch - Starter for using Spring Batch
Example for this starter available on GitHub spring-boot-sample-batch
>> spring-boot-starter-cache - Starter for using Spring Framework’s caching support
Example for this starter available on GitHub spring-boot-sample-cache
>> spring-boot-starter-data-cassandra - Starter 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-couchbase - Starter 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-elasticsearch - Starter 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-ldap - Starter for using Spring Data LDAP
Example for this starter available on GitHub spring-boot-sample-data-ldap
>> spring-boot-starter-data-mongodb - Starter 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-neo4j - Starter 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-redis - Starter 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-rest - Starter 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-solr - Starter 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-hateoas - Starter 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-integration - Starter for using Spring Integration
Example for this starter available on GitHub spring-boot-sample-integration
>> spring-boot-starter-jdbc - Starter for using JDBC with the HikariCP connection pool
Example for this starter available on GitHub spring-boot-sample-web-secure-jdbc
>> spring-boot-starter-jersey - Starter 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-mustache - Starter for building web applications using Mustache views
Example for this starter available on GitHub spring-boot-sample-web-mustache
>> spring-boot-starter-quartz - Starter for using the Quartz scheduler
Example for this starter available on GitHub spring-boot-sample-quartz
>> spring-boot-starter-security - Starter for using Spring Security
Example for this starter: spring-boot-sample-secure
>> spring-boot-starter-web-services - Starter for using Spring Web Services
Example for this starter available on GitHub spring-boot-sample-webservices
>> spring-boot-starter-webflux - Starter 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-websocket - Starter 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:
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:
Comments
Post a Comment
Leave Comment