正如Day 04 - Spring Boot 的前世今生所說,Spring Boot 為了簡化設定提供了大量開箱即用的starter,這邊會列出一些常用的依賴,雖然不會每個都實作一遍,但先知道有支援哪些功能,未來開發有需要時才用得到。
Starter for building web, including RESTful, applications using Spring MVC. Uses Tomcat as the default embedded container
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
Starter for testing Spring Boot applications with libraries including JUnit Jupiter, Hamcrest and Mockito
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
Starter for using Spring Data JPA with Hibernate
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
Starter for using Spring Data JDBC
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jdbc</artifactId>
</dependency>
Starter for building MVC web applications using Thymeleaf views
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
Starter for using Java Mail and Spring Framework's email sending support
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId>
</dependency>
Starter for using Spring Integration
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
</dependency>
Starter for using Redis key-value data store with Spring Data Redis and the Lettuce client
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
</dependency>
Starter for using Java Bean Validation with Hibernate Validator
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
</dependency>
Starter for building WebSocket applications using Spring Framework's WebSocket support
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-websocket</artifactId>
</dependency>
Starter for using Spring Web Services
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web-services</artifactId>
</dependency>
Starter for building hypermedia-based RESTful web application with Spring MVC and Spring HATEOAS
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>
Starter for using Spring Security
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>