Spring Cloud Starters的优点

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/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值