springboot 常见的启动器

 <!--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

猜你喜欢

转载自www.cnblogs.com/houchen/p/12046769.html