SpringBoot+Vue3第二章 SpringBoot引入相关的依赖

第一章已经将了如何搭建使用Maven搭建项目并引入相关的SpringBoot包和使用Vue-cli搭建Vue工程。那么本章节将讲解SpringBoot本项目开发所需的一些相关的依赖包。和在application.yml中配置一些基本的属性

一、该项目目前所需的相关依赖

  • SpringBoot 2.5.10
  • undertow 服务器 该项目我们使用的undertow服务器  排除SpringBoot 自带的tomcat服务器
  • devtools  SpringBoot 热部署
  • SpringSecurity SpringBoot权限认证管理
  • JWT 0.9.1 生成随机的Token字符串 + SpringSecurity
  • Mysql mysql数据库支持
  • JDBC 数据连接驱动池
  • Redis Redis缓存相关数据库
  • Jredis Redis客户端操作
  • mybatis-plus SQL数据操作
    • mybatis-plus-generator 代码生成相关依赖
  • velocity 模板引擎  使用mybatis-plus-generator代码生成时所需依赖的包
  • lombox 简化实体类的相关操作
  • houtool 减少代码搜索成本
  • fastjson 对于JSON的支持
  • junit 测试所需依赖的包

以下是Maven相关的依赖



    4.0.0

    cn.mshangqs
    SpringProject-demo
    1.0


    
        spring-boot-starter-parent
        org.springframework.boot
        2.5.10
    

    
        
            org.springframework.boot
            spring-boot-starter-web
            
                
                    org.springframework.boot
                    spring-boot-starter-tomcat
                
            
        
        
            org.springframework.boot
            spring-boot-starter-undertow
        
        
            org.springframework.boot
            spring-boot-devtools
            runtime
            true
        

        
        
            org.springframework.boot
            spring-boot-starter-security
        
        
            io.jsonwebtoken
            jjwt
            0.9.1
        

        
        
            org.springframework.boot
            spring-boot-starter-jdbc
        
        
            mysql
            mysql-connector-java
            runtime
        
        
            org.springframework.boot
            spring-boot-starter-data-redis
            
                
                    redis.clients
                    jedis
                
            
        
        
            redis.clients
            jedis
            2.9.3
        

        
        
            com.baomidou
            mybatis-plus-boot-starter
            3.5.1
        
        
            com.baomidou
            mybatis-plus-generator
            3.5.1
        
        
            org.apache.velocity
            velocity-engine-core
            2.0
        

        
        
            org.projectlombok
            lombok
        

        
            cn.hutool
            hutool-all
            5.7.15
        

        
        
            com.alibaba
            fastjson
            1.2.78
        

        
        
            commons-fileupload
            commons-fileupload
            1.3.3
        

        
        
            junit
            junit
            4.11
            test
        
        
            org.springframework.boot
            spring-boot-starter-test
        


    


    
        
            
                org.springframework.boot
                spring-boot-maven-plugin
                
                    
                        
                            org.projectlombok
                            lombok
                        
                    
                
            
        
    


打开application.yml 文件 配置undertow、mysql、redis和mybatis

server:
  port: 8090 #服务器启动的端口号

  undertow:
    direct-buffers: true
    threads:
      io: 5 # I/O线程数
      worker: 160
    accesslog:
      enabled: false #是否默认打开undertow日志

  servlet:
    context-path: /api/service  # 请求路径统一

spring:
#  mysql相配置
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://localhost:3306/spring-project?useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&useSSL=false
    username: root
    password: 更换自己的密码


#redis相关配置
  redis:
    jedis:
      pool:
        max-active: 20
        max-wait: 30000
        max-idle: 20
        min-idle: 10
    host: 更换自己的redis地址
    port: 6379
    timeout: 3000

#mybatis配置
mybatis-plus:
  mapper-locations: classpath:mapper/*.xml
  type-aliases-package: cn.mshangqs.entity
  configuration:
    auto-mapping-behavior: full

 SpringBoot+Vue3第二章 SpringBoot引入相关的依赖_第1张图片

SpringBoot+Vue3第二章 SpringBoot引入相关的依赖_第2张图片 通过以上的步骤  基本本项目所需的一些依赖就安装完成了 下一章我将介绍使用Mybatis-plsu-generator结合mysql生成controller、service、mapper和相关的XML文件....

 

你可能感兴趣的:(spring,boot,java,maven)