- Mastering Spring Boot 2.0
- Dinesh Rajput
- 352字
- 2021-06-25 21:29:11
Spring Boot Starters
Starter is like a small Spring project for each module such as web MVC, JDBC, ORM, and so on. For your Spring application, you just add the starters of the respective module in the classpath, and Spring Boot will ensure that the necessary libraries are added to the build by using Maven or Gradle. As a developer, you don't need to worry about the module libraries and dependent versions of libraries, that is, transitive dependencies.
Spring Boot documentation says 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.
Suppose you want to create a web application or an application to expose RESTful services using the Spring web MVC module to your Spring application; just include the spring-boot-starter-web dependency in your project, and you are good to go.
Let's see what it would look like in the Spring application:
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies>
This starter dependency resolves the following transitive dependencies:
- spring-web-*.jar
- spring-webmvc-*.jar
- tomcat-*.jar
- jackson-databind-*.jar
See the following diagram about spring-boot-starter-web:

The spring-boot-starter not only reduces the build dependency count, but also adds specific functionality to your build. In your case, you added the web starter to your Spring application, so it provides web functionality that your application needs. Similarly, if your application will use ORM, then you can add the orm starter. If it needs security, you can add the security starter.
Spring Boot provides a wide range of Starter projects. Spring Boot provides the following application Starters under the org.springframework.boot group:
- spring-boot-starter-web-services: For building applications exposing SOAP web services
- spring-boot-starter-web: Build web applications and RESTful applications
- spring-boot-starter-test: Write great unit and integration tests
- spring-boot-starter-jdbc: Traditional JDBC applications
- spring-boot-starter-hateoas: Make your services more RESTful by adding HATEOAS features
- spring-boot-starter-security: Authentication and authorization using Spring Security
- spring-boot-starter-data-jpa: Spring Data JPA with Hibernate
- spring-boot-starter-cache: Enabling the Spring Framework's caching support
- spring-boot-starter-data-rest: Expose simple REST services using Spring Data REST
- MATLAB 2020中文版從入門到精通
- Hands-On G Suite for Administrators
- Office 2013輕松辦公:Word/Excel/PowerPoint三合一超級應用大全(實戰案例版)
- 輕松學五筆打字
- Excel 2013超級應用大全(實戰案例版)
- 非常Easy:Office高效辦公
- Office 2007辦公軟件應用立體化教程
- Excel/PPT 2016辦公專家從入門到精通
- Photoshop+Illustrator平面設計案例實戰從入門到精通:視頻自學全彩版
- MATLAB及Mathematica軟件應用
- Office辦公軟件案例教程(第4版)
- 精P之道:高效溝通PPT
- Learn Microsoft Office 2019
- Word/Excel/PPT 2007入門與提高
- WOW!電腦辦公可以這樣簡單