Introduction
Before starting any project be it a small project or an enterprise level application, one of the critical aspects is dependency management, doing it manually for a small application is not a hard job but for complex applications, managing all project dependencies manually is not ideal and prone to many issues as well wasting of the time which can be used in some other important aspects of the project.
One of the fundamental principle behind Spring Boot is to address similar issues. Spring Boot Starters are a set of convenient dependency descriptors which can be easily included in any level of application. These starters work as a bootstrapping process for the Spring related technologies, we no longer need to worry about the dependencies and they will be automatically managed by Spring Boot Starters.
The starters contain a lot of the dependencies you need to get a project up and running quickly and with a consistent, supported a set of managed transitive dependencies.
1. Why Do We Need Starters?
When we start with the Spring Boot, one of the fundamental questions which come to our mind is why do we need Spring Boot Starters? or how these starters will help me in my application?
As mentioned earlier, these starters work to bootstrap your application, all we need is to include correct starter in our application and Spring Boot will ensure that all dependencies required for the chosen starter are in your classpath.To understand it more let’s take an example where we want to build a simple Spring Web-MVC application, to start, we need to think of the following points before working on our web application code.
- Correct Spring MVC Dependencies.
- Required dependencies for Web technologies (e.g. We want to use Thymeleaf)
- We need to make sure that all these dependencies are compatible
With Spring Boot Starters, bootstrapping our Spring-MVC web application is straightforward, We need to include spring-boot-starter-web starter in our pom.xml,
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
Above entry in pom.xml will ensure that all required dependencies should be in your classpath and we are all set to work on our web application. There are around 50+ starters offered by Spring Boot excluding third party starters. For the updated list of starters, please refer to Spring Boot Starter
https://www.javadevjournal.com/spring-boot/spring-boot-starters/