常用依赖
< ? xml version= "1.0" encoding= "UTF-8" ? >
< project xmlns= "http://maven.apache.org/POM/4.0.0" xmlns: xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi: schemaLocation= "http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" >
< modelVersion> 4.0 .0 < / modelVersion>
< ! -- 引入父类项目-- >
< parent>
< groupId> org. springframework. boot< / groupId>
< artifactId> spring- boot- starter- parent< / artifactId>
< version> 2.1 .5 . RELEASE< / version>
< / parent>
< groupId> com. ** * < / groupId>
< artifactId> UserModel< / artifactId>
< version> 1.0 - SNAPSHOT< / version>
< properties>
< java. version> 1.8 < / java. version>
< / properties>
< dependencies>
< ! -- 引入springboot的web支持( web启动器) -- >
< dependency>
< groupId> org. springframework. boot< / groupId>
< artifactId> spring- boot- starter- web< / artifactId>
< / dependency>
< ! -- springboot的测试依赖-- >
< dependency>
< groupId> org. springframework. boot< / groupId>
< artifactId> spring- boot- starter- test< / artifactId>
< scope> test< / scope>
< / dependency>
< ! -- springboot的aop依赖-- >
< dependency>
< groupId> org. springframework. boot< / groupId>
< artifactId> spring- boot- starter- aop< / artifactId>
< / dependency>
< ! -- tomcat- embed- jasper 依赖-- >
< dependency>
< groupId> org. apache. tomcat. embed< / groupId>
< artifactId> tomcat- embed- jasper< / artifactId>
< scope> provided< / scope>
< / dependency>
< ! -- jstl 依赖-- >
< dependency>
< groupId> jstl< / groupId>
< artifactId> jstl< / artifactId>
< version> 1.2 < / version>
< scope> provided< / scope>
< / dependency>
< ! -- 配置文件自动提示依赖-- >
< dependency>
< groupId> org. springframework. boot< / groupId>
< artifactId> spring- boot- configuration- processor< / artifactId>
< optional> true < / optional>
< / dependency>
< ! -- devtools 依赖-- >
< dependency>
< groupId> org. springframework. boot< / groupId>
< artifactId> spring- boot- devtools< / artifactId>
< / dependency>
< ! -- 上传工具类 依赖 -- >
< dependency>
< groupId> commons- fileupload< / groupId>
< artifactId> commons- fileupload< / artifactId>
< version> 1.3 .3 < / version>
< / dependency>
< ! -- Mysql 依赖-- >
< dependency>
< groupId> mysql< / groupId>
< artifactId> mysql- connector- java< / artifactId>
< version> 5.1 .44 < / version>
< / dependency>
< ! -- druid 依赖-- >
< dependency>
< groupId> com. alibaba< / groupId>
< artifactId> druid< / artifactId>
< version> 1.1 .10 < / version>
< / dependency>
< ! -- Mybatis 依赖-- >
< dependency>
< groupId> org. mybatis. spring. boot< / groupId>
< artifactId> mybatis- spring- boot- starter< / artifactId>
< version> 1.3 .2 < / version>
< / dependency>
< ! -- lombok 依赖-- >
< dependency>
< groupId> org. projectlombok< / groupId>
< artifactId> lombok< / artifactId>
< version> 1.18 .8 < / version>
< scope> provided< / scope>
< / dependency>
< / dependencies>
< build>
< ! -- 允许页面热部署-- >
< plugins>
< plugin>
< groupId> org. springframework. boot< / groupId>
< artifactId> spring- boot- maven- plugin< / artifactId>
< / plugin>
< / plugins>
< / build>
< / project>
mybatis-plus
< ! -- mybatis- plus 依赖 -- >
< dependency>
< groupId> com. baomidou< / groupId>
< artifactId> mybatis- plus- boot- starter< / artifactId>
< / dependency>
Redis依赖
< ! -- redis 依赖 -- >
< dependency>
< groupId> redis. clients< / groupId>
< artifactId> jedis< / artifactId>
< version> 2.9 .0 < / version>
< / dependency>
< ! -- redis的启动器 redisTemplate-- >
< dependency>
< groupId> org. springframework. boot< / groupId>
< artifactId> spring- boot- starter- data- redis< / artifactId>
< / dependency>
< ! -- redis支持共享session-- >
< dependency>
< groupId> org. springframework. session< / groupId>
< artifactId> spring- session- data- redis< / artifactId>
< / dependency>
Elastic Search依赖
< ! -- elastic search的核心包-- >
< dependency>
< groupId> org. elasticsearch< / groupId>
< artifactId> elasticsearch< / artifactId>
< version> 6.2 .4 < / version>
< / dependency>
< ! -- 封装了httpclient 让你通过java代码操作es-- >
< dependency>
< groupId> org. elasticsearch. client< / groupId>
< artifactId> transport< / artifactId>
< version> 6.2 .4 < / version>
< / dependency>
< ! -- 通过spring data 操作Es-- >
< dependency>
< groupId> org. springframework. boot< / groupId>
< artifactId> spring- boot- starter- data- elasticsearch< / artifactId>
< / dependency>
Swagger依赖
< ! -- Swagger 依赖 -- >
< dependency>
< groupId> io. springfox< / groupId>
< artifactId> springfox- swagger2< / artifactId>
< / dependency>
< dependency>
< groupId> io. springfox< / groupId>
< artifactId> springfox- swagger- ui< / artifactId>
< / dependency>
JWT依赖
< ! -- JWT 依赖 -- >
< dependency>
< groupId> io. jsonwebtoken< / groupId>
< artifactId> jjwt< / artifactId>
< / dependency>
Spring Security依赖
< ! -- Spring Security 依赖 -- >
< dependency>
< groupId> org. springframework. boot< / groupId>
< artifactId> spring- boot- starter- security< / artifactId>
< / dependency>
SpringCloud依赖
< ! -- Spring Cloud 依赖 -- >
< dependency>
< groupId> org. springframework. cloud< / groupId>
< artifactId> spring- cloud- dependencies< / artifactId>
< version> Hoxton. RELEASE< / version>
< type> pom< / type>
< scope> import < / scope>
< / dependency>
SpringCloud:Nacos
< ! -- Nacos 依赖 -- >
< dependency>
< groupId> org. springframework. cloud< / groupId>
< artifactId> spring- cloud- starter- alibaba- nacos- discovery< / artifactId>
< / dependency>
SpringCloud:GateWay
< ! -- GateWay 依赖 -- >
< dependency>
< groupId> org. springframework. cloud< / groupId>
< artifactId> spring- cloud- starter- gateway< / artifactId>
< / dependency>
SpringCloud:Feign
< ! -- Feign 依赖 -- >
< dependency>
< groupId> org. springframework. cloud< / groupId>
< artifactId> spring- cloud- starter- openfeign< / artifactId>
< / dependency>
SpringCloud:Hystrix
< ! -- Hystrix 依赖 -- >
< dependency>
< groupId> org. springframework. cloud< / groupId>
< artifactId> spring- cloud- starter- netflix- hystrix< / artifactId>
< / dependency>
SpringCloud:Ribbon
< ! -- ribbon 依赖 -- >
< dependency>
< groupId> org. springframework. cloud< / groupId>
< artifactId> spring- cloud- starter- netflix- ribbon< / artifactId>
< / dependency>
微信支付
< ! -- 微信支付依赖 -- >
< dependency>
< groupId> com. github. wxpay< / groupId>
< artifactId> wxpay- sdk< / artifactId>
< / dependency>
SpringBoot通用配置
server :
port : 9090
servlet :
jsp :
init-parameters :
development : true
context-path : /user
tomcat :
uri-encoding : UTF- 8
spring :
http :
encoding :
charset : UTF- 8
force : true
mvc :
date-format : yyyy- MM- dd
view :
prefix : /
suffix : .jsp
datasource :
master :
type : com.alibaba.druid.pool.DruidDataSource
username : root
password : root
driver-class-name : com.mysql.jdbc.Driver
jdbc-url : jdbc: mysql: //localhost: 3306/lf? useUnicode=true&characterEncoding =UTF8&serverTimezone =UTC&useSSL =false
slave1 :
type : com.alibaba.druid.pool.DruidDataSource
username : root
password : root
driver-class-name : com.mysql.jdbc.Driver
jdbc-url : jdbc: mysql: //localhost: 3306/lf? useUnicode=true&characterEncoding =UTF8&serverTimezone =UTC&useSSL =false
slave2 :
type : com.alibaba.druid.pool.DruidDataSource
username : root
password : root
driver-class-name : com.mysql.jdbc.Driver
jdbc-url : jdbc: mysql: //localhost: 3306/lf? useUnicode=true&characterEncoding =UTF8&serverTimezone =UTC&useSSL =false
type : com.alibaba.druid.pool.DruidDataSource
driver-class-name : com.mysql.jdbc.Driver
url : jdbc: mysql: //localhost: 8066/mycat
username : root
password : root
type : com.alibaba.druid.pool.DruidDataSource
driver-class-name : com.mysql.jdbc.Driver
url : jdbc: mysql: //localhost: 3306/lf? useUnicode=true&characterEncoding =UTF8&serverTimezone =UTC&useSSL =false
jackson :
date-format : yyyy- MM- dd
time-zone : GMT+8
servlet :
multipart :
enabled : true
max-file-size : 5MB
max-request-size : 50MB
location : /E: /temp
redis :
host : localhost
port : 6379
timeout : 5s
lettuce :
pool :
max-active : 10
max-idle : 8
max-wait : 5ms
min-idle : 1
shutdown-timeout : 100ms
mybatis :
mapper-locations : classpath: com/lf/mapper/*.xml
type-aliases-package : com.lf.pojo
executor-type : batch
logging :
level :
root : error
com.baizhi.dao : debug
com.baizhi.service : warn
com.baizhi.controller : warn
fdfs :
tracker-list : pro1: 22122 , pro2: 22122
thumb-image :
height : 80
width : 80