<!--pringBoot提供了一個名為spring-boot-starter-parent的工程,
里面已經對各種常用依賴(並非全部)的版本進行了管理
我們的項目需要以這個項目為父工程,這樣我們就不用操心依賴的版本問題了-->
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
</parent>
<!-- web啟動器 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<!--mybatis -->
<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <version>1.3.2</version> </dependency>
# mybatis 別名掃描
mybatis.type-aliases-package=com.heima.pojo
# mapper.xml文件位置,如果沒有映射文件,請注釋掉
mybatis.mapper-locations=classpath:mappers/*.xml
<!-- 通用mapper --> <dependency> <groupId>tk.mybatis</groupId> <artifactId>mapper-spring-boot-starter</artifactId> <version>2.0.2</version> </dependency>
@Mapper
public interface UserMapper extends tk.mybatis.mapper.common.Mapper<User>{
}
<!-- themeleaf 模板--> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>
#Thymeleaf會在第一次對模板解析之后進行緩存,極大的提高了並發處理能力
# 開發階段關閉thymeleaf的模板緩存
spring.thymeleaf.cache=false