• 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

  • 相关阅读:
    IDEA中代码无故报红解决方法
    CAP原则的基本理论知识
    Java IO 拷贝MP3文件,包括递归子文件夹下的文件
    maven 配置阿里云镜像 settings.xml内容
    Restful API 级别及意义
    日常巡检(脚本)
    使用Matplotlib画图系列(一)
    Python 阶乘factorial
    交叉验证思想
    FeatureSelectors
  • 原文地址:https://www.cnblogs.com/houchen/p/12046769.html
Copyright © 2020-2023  润新知