Do you think IIT Guwahati certified course can help you in your career?
No
Introduction
Dependency management is one of the critical aspects of any project. And managing this manually is less than ideal; the more time we spend on it, the less time we have on the crucial aspects of the project.
Spring Boot provides us with several Spring Boot Starters to address this problem. The built-in Spring Boot starters make the development very rapid and easy. They are a set of convenient dependency descriptors that we can use to bootstrap our spring applications. Spring boot starters contain a lot of pre-defined dependencies with a supported set of transitive dependencies.
We have more than 30 Spring Boot starters available. Let's see some of them in this article.
Spring Boot starters are a set of convenient dependency descriptors that we can use to bootstrap our spring applications. It contains a lot of pre-defined dependencies with a supported set of transitive dependencies.
We have a naming pattern for the starters in the Spring Boot: spring-boot-starter-*, where the * denotes a particular type of application. For reference, if we want to use Spring Web Services, we need to include the spring-boot-starter-web-services dependency in the pom.xml file of our project.
You can also consider our Spring Boot Course to give your career an edge over others.
Popular Spring Boot Starters
In this section, we will discuss the popular spring boot starters with a quick brief about all of them. Spring boot offers more than 30 starters to make our work easy and quick.
Name
Description
spring-boot-starter
This starter is the core starter which includes auto-configuration support, YAML and logging
spring-boot-starter-activemq
This starter is used in JMS (Java Message Service) messaging using Apache ActiveMQ.
spring-boot-starter-aop
This Starter is for aspect-oriented programming with Spring AOP(Aspect Oriented Programming) and AspectJ.
spring-boot-starter-batch
This Starter is for using Spring Batch.
spring-boot-starter-cache
This Starter is for using caching support of Spring Framework.
spring-boot-starter-cloud-connectors
This starter is used for Spring Cloud Connectors, which simplifies connecting to cloud platforms like Heroku.
spring-boot-starter-data-elasticsearch
This Starter uses Elasticsearch search and Spring Data Elasticsearch and analytics engine.
spring-boot-starter-data-jpa
This Starter is for using Spring Data JPA (Java Persistent API) with Hibernate
spring-boot-starter-data-ldap
This Starter uses Spring Data LDAP (Lightweight Directory Access Protocol).
spring-boot-starter-data-mongodb
This Starter is used for MongoDB database and Spring Data MongoDB.
spring-boot-starter-data-redis
This Starter is used for Redis key-value data store with Lettuce client and the Spring Data Redis.
spring-boot-starter-data-rest
This Starter is used for exposing Spring Data repositories over REST using Spring Data REST
spring-boot-starter-freemarker
This Starter is used for building MVC (Model-View-Controller) web applications using the FreeMarker views
spring-boot-starter-groovy-templates
This Starter is used for building the MVC web applications using Groovy Template views.
spring-boot-starter-hateoas
This Starter is used for building hypermedia-based RESTful web applications with Spring HATEOAS and Spring MVC
spring-boot-starter-integration
This Starter is used for Spring Integration
spring-boot-starter-jdbc
This Starter is used for JDBC with the Tomcat JDBC connection pool
spring-boot-starter-jersey
This Starter is used for building RESTful web applications using JAX-RS (JAVA API for RESTful Web Services) and Jersey. It is an alternative for spring-boot-starter-web
spring-boot-starter-jta-atomikos
This starter is used for JTA (Java Transaction API) transactions using Atomikos.
spring-boot-starter-jta-bitronix
This starter is used for JTA (Java Transaction API) transactions using Bitronix.
spring-boot-starter-json
This Starter is used for reading and writing JSON (JavaScript Object Notation).
spring-boot-starter-mail
This Starter is used for Spring Framework’s email sending support and Java mail.
spring-boot-starter-mustache
This starter is used for building MVC web applications using Mustache views.
spring-boot-starter-quartz
This Starter is used for the Quartz scheduler.
spring-boot-starter-security
This Starter is used for Spring Security.
spring-boot-starter-social-facebook
This starter is used for Spring Social Facebook.
spring-boot-starter-social-LinkedIn
This starter is used for Spring Social LinkedIn.
spring-boot-starter-social-twitter
This starter is used for Spring Social Twitter.
spring-boot-starter-test
This Starter is used for testing Spring Boot applications with libraries including Hamcrest, JUnit and Mockito.
spring-boot-starter-thymeleaf
This Starter is used for building MVC web applications using Thymeleaf views.
spring-boot-starter-validation
This Starter is used for Java Bean Validation with Hibernate Validator.
spring-boot-starter-web
This Starter is used for building web, which includes RESTful applications using Spring MVC. It uses Tomcat as the default embedded container.
spring-boot-starter-web-services
This Starter is used for Spring Web Services.
spring-boot-starter-websocket
This Starter is used for building WebSocket applications. It uses WebSocket support of Spring Framework.
Spring Boot Starters for Production
This section will discuss the available spring boot starters for service after the production of the application.
Name
Description
spring-boot-starter-actuator
This starter is used for Spring Boot's Actuator, providing production-ready features to help us monitor and manage our application.
spring-boot-starter-remote-shell
This starter is used for the CRaSH remote shell to monitor and manage our application over SSH (Secure Socket Shell).
Note: Deprecated since v-1.5.
Spring Boot Technical Starters
In this section, we will learn the starters related to logging and tomcat.
Name
Description
spring-boot-starter-undertow
This starter is used for Undertow as the embedded servlet container. It is an alternative for the spring-boot-starter-tomcat.
spring-boot-starter-jetty
This starter is used for Jetty as the embedded servlet container. It is an alternative for the spring-boot-starter-tomcat.
spring-boot-starter-logging
This starter is used for logging using Logback.
spring-boot-starter-log4j2
This starter is used for Log4j2 for logging. It is an alternative for the spring-boot-starter-logging.
spring-boot-starter-tomcat
This starter is used for Tomcat as the embedded servlet container.
Advantages of Spring Boot Starters
Simplified Dependency Management: Predefined dependencies reduce the need to manually specify versions and compatible libraries.
Rapid Development: Automatically configures commonly used libraries and tools, speeding up the development process.
Consistency: Ensures consistent dependency versions, reducing compatibility issues between libraries.
Built-in Support for Popular Frameworks: Offers integration with frameworks like JPA, Web, Security, and Test without manual configuration.
Reduced Configuration Effort: Eliminates boilerplate configurations for common use cases, such as web development or messaging.
Ease of Testing: Starter dependencies include libraries like JUnit and Mockito for seamless testing setup.
Customizable: Default configurations can be overridden to suit specific project requirements.
Improved Productivity: Developers can focus on business logic instead of managing dependencies or configurations.
Third-Party Starters for Spring Boot
Database Starters: com.github.gavlyukovskiy:p6spy-spring-boot-starter: Enables database query logging using P6Spy. com.h2database:h2: Lightweight database starter for development and testing.
Message Brokers: org.springframework.boot:spring-boot-starter-amqp: Starter for RabbitMQ integration. io.awspring.cloud:spring-cloud-aws-messaging: Starter for AWS SQS.
Logging: net.logstash.logback:logstash-logback-encoder: Provides enhanced logging capabilities and integration with Logstash.
Security and Authentication: org.springframework.boot:spring-boot-starter-oauth2-client: Adds OAuth2 support for client applications. com.okta.spring:okta-spring-boot-starter: Simplifies Okta integration for authentication.
Monitoring and Metrics: io.micrometer:micrometer-registry-prometheus: Adds support for exporting metrics to Prometheus. org.springframework.boot:spring-boot-starter-actuator: Provides endpoints for monitoring and managing the application.
Cloud and Containerization: org.springframework.cloud:spring-cloud-starter-kubernetes: Simplifies Kubernetes integration. org.springframework.cloud:spring-cloud-starter-aws: Starter for Amazon Web Services.
Frontend Integration: com.github.eirslett:frontend-maven-plugin: Helps manage frontend dependencies like Node.js and npm in Spring Boot projects.
Search Engines: org.springframework.boot:spring-boot-starter-data-elasticsearch: Integrates Elasticsearch for search functionality.
Payment Gateways: com.stripe:stripe-java: Simplifies integration with the Stripe payment gateway.
Frequently Asked Questions
What is a Spring Boot?
Spring Boot is a Spring module that extends the Spring framework's Rapid Application Development capabilities. It's used to create stand-alone spring-based applications.
What are the main benefits of Spring Boot Starters?
Spring Boot starters are mainly used to make development very easy and rapid. They make dependency management quick so that we can focus more and more on programming logic for our project.
Conclusion
In this article, we learned about spring boot starters. We discussed the naming convention for spring boot starters and third-party starters. We also discussed the popular spring boot starters with their usage in brief.