update springboot 升级 2.3.10 依赖全面升级适配
This commit is contained in:
parent
d2c745d3fd
commit
dab99405c5
3
pom.xml
3
pom.xml
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<ruoyi-vue-plus.version>1.0.2</ruoyi-vue-plus.version>
|
<ruoyi-vue-plus.version>1.0.2</ruoyi-vue-plus.version>
|
||||||
|
<spring-boot.version>2.3.10.RELEASE</spring-boot.version>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
@ -41,7 +42,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-dependencies</artifactId>
|
<artifactId>spring-boot-dependencies</artifactId>
|
||||||
<version>2.2.13.RELEASE</version>
|
<version>${spring-boot.version}</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -6,7 +6,7 @@ spring:
|
|||||||
druid:
|
druid:
|
||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
url: jdbc:mysql://192.168.0.222:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
|
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8&autoReconnect=true
|
||||||
username: root
|
username: root
|
||||||
password: root
|
password: root
|
||||||
# 从库数据源
|
# 从库数据源
|
||||||
@ -58,7 +58,7 @@ spring:
|
|||||||
# redis 配置
|
# redis 配置
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: 192.168.0.222
|
host: localhost
|
||||||
# 端口,默认为6379
|
# 端口,默认为6379
|
||||||
port: 6379
|
port: 6379
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
|
@ -26,7 +26,7 @@ captcha:
|
|||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
server:
|
server:
|
||||||
# 服务器的HTTP端口,默认为8080
|
# 服务器的HTTP端口,默认为8080
|
||||||
port: 8080
|
port: 8081
|
||||||
servlet:
|
servlet:
|
||||||
# 应用的访问路径
|
# 应用的访问路径
|
||||||
context-path: /
|
context-path: /
|
||||||
@ -37,12 +37,13 @@ server:
|
|||||||
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
|
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
|
||||||
# 每块buffer的空间大小,越小的空间被利用越充分
|
# 每块buffer的空间大小,越小的空间被利用越充分
|
||||||
buffer-size: 512
|
buffer-size: 512
|
||||||
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
|
|
||||||
io-threads: 8
|
|
||||||
# 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
|
|
||||||
worker-threads: 256
|
|
||||||
# 是否分配的直接内存
|
# 是否分配的直接内存
|
||||||
direct-buffers: true
|
direct-buffers: true
|
||||||
|
threads:
|
||||||
|
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
|
||||||
|
io: 8
|
||||||
|
# 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
|
||||||
|
worker: 256
|
||||||
# # tomcat 配置
|
# # tomcat 配置
|
||||||
# tomcat:
|
# tomcat:
|
||||||
# # tomcat的URI编码
|
# # tomcat的URI编码
|
||||||
@ -83,33 +84,6 @@ spring:
|
|||||||
thymeleaf:
|
thymeleaf:
|
||||||
# 将系统模板放置到最前面 否则会与 springboot-admin 页面冲突
|
# 将系统模板放置到最前面 否则会与 springboot-admin 页面冲突
|
||||||
template-resolver-order: 1
|
template-resolver-order: 1
|
||||||
application:
|
|
||||||
name: ruoyi-vue-plus
|
|
||||||
boot:
|
|
||||||
admin:
|
|
||||||
# Spring Boot Admin Client 客户端的相关配置
|
|
||||||
client:
|
|
||||||
# 设置 Spring Boot Admin Server 地址
|
|
||||||
url: http://localhost:${server.port}${spring.boot.admin.context-path}
|
|
||||||
instance:
|
|
||||||
prefer-ip: true # 注册实例时,优先使用 IP
|
|
||||||
# username: ruoyi
|
|
||||||
# password: 123456
|
|
||||||
# Spring Boot Admin Server 服务端的相关配置
|
|
||||||
context-path: /admin # 配置 Spring
|
|
||||||
|
|
||||||
# Actuator 监控端点的配置项
|
|
||||||
management:
|
|
||||||
endpoints:
|
|
||||||
web:
|
|
||||||
# Actuator 提供的 API 接口的根目录。默认为 /actuator
|
|
||||||
base-path: /actuator
|
|
||||||
exposure:
|
|
||||||
# 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
|
||||||
include: '*'
|
|
||||||
endpoint:
|
|
||||||
logfile:
|
|
||||||
external-file: ./logs/sys-console.log
|
|
||||||
|
|
||||||
# token配置
|
# token配置
|
||||||
token:
|
token:
|
||||||
@ -120,7 +94,7 @@ token:
|
|||||||
# 令牌有效期(默认30分钟)
|
# 令牌有效期(默认30分钟)
|
||||||
expireTime: 30
|
expireTime: 30
|
||||||
|
|
||||||
# MyBatis配置
|
# MyBatisPlus配置
|
||||||
# https://baomidou.com/config/
|
# https://baomidou.com/config/
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
mapperPackage: com.ruoyi.**.mapper
|
mapperPackage: com.ruoyi.**.mapper
|
||||||
@ -209,13 +183,6 @@ mybatis-plus:
|
|||||||
# 字段验证策略之 select,在 select 的时候的字段验证策略既 wrapper 根据内部 entity 生成的 where 条件
|
# 字段验证策略之 select,在 select 的时候的字段验证策略既 wrapper 根据内部 entity 生成的 where 条件
|
||||||
selectStrategy: NOT_EMPTY
|
selectStrategy: NOT_EMPTY
|
||||||
|
|
||||||
# PageHelper分页插件
|
|
||||||
pagehelper:
|
|
||||||
helperDialect: mysql
|
|
||||||
reasonable: true
|
|
||||||
supportMethodsArguments: true
|
|
||||||
params: count=countSql
|
|
||||||
|
|
||||||
# Swagger配置
|
# Swagger配置
|
||||||
swagger:
|
swagger:
|
||||||
# 是否开启swagger
|
# 是否开启swagger
|
||||||
@ -238,6 +205,7 @@ xss:
|
|||||||
# 匹配链接
|
# 匹配链接
|
||||||
urlPatterns: /system/*,/monitor/*,/tool/*
|
urlPatterns: /system/*,/monitor/*,/tool/*
|
||||||
|
|
||||||
|
# 全局线程池相关配置
|
||||||
threadPoolConfig:
|
threadPoolConfig:
|
||||||
# 是否开启线程池
|
# 是否开启线程池
|
||||||
enabled: false
|
enabled: false
|
||||||
@ -256,6 +224,7 @@ threadPoolConfig:
|
|||||||
# AbortPolicy 中止
|
# AbortPolicy 中止
|
||||||
rejectedExecutionHandler: CallerRunsPolicy
|
rejectedExecutionHandler: CallerRunsPolicy
|
||||||
|
|
||||||
|
# feign 相关配置
|
||||||
feign:
|
feign:
|
||||||
package: com.ruoyi.**.feign
|
package: com.ruoyi.**.feign
|
||||||
# 开启压缩
|
# 开启压缩
|
||||||
@ -268,3 +237,64 @@ feign:
|
|||||||
enabled: true
|
enabled: true
|
||||||
hystrix:
|
hystrix:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
||||||
|
--- # 定时任务配置
|
||||||
|
spring:
|
||||||
|
quartz:
|
||||||
|
scheduler-name: RuoyiScheduler
|
||||||
|
startup-delay: 1s
|
||||||
|
overwrite-existing-jobs: true
|
||||||
|
auto-startup: true
|
||||||
|
job-store-type: jdbc
|
||||||
|
properties:
|
||||||
|
org:
|
||||||
|
quartz:
|
||||||
|
# Scheduler 相关配置
|
||||||
|
scheduler:
|
||||||
|
instanceName: RuoyiScheduler
|
||||||
|
instanceId: AUTO
|
||||||
|
# 线程池相关配置
|
||||||
|
threadPool:
|
||||||
|
class: org.quartz.simpl.SimpleThreadPool
|
||||||
|
threadCount: 20
|
||||||
|
threadPriority: 5
|
||||||
|
# JobStore 集群配置
|
||||||
|
jobStore:
|
||||||
|
class: org.quartz.impl.jdbcjobstore.JobStoreTX
|
||||||
|
isClustered: true
|
||||||
|
clusterCheckinInterval: 15000
|
||||||
|
txIsolationLevelSerializable: true
|
||||||
|
misfireThreshold: 60000
|
||||||
|
tablePrefix: QRTZ_
|
||||||
|
# sqlserver 启用
|
||||||
|
# selectWithLockSQL: SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?
|
||||||
|
|
||||||
|
--- # 监控配置
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: ruoyi-vue-plus
|
||||||
|
boot:
|
||||||
|
admin:
|
||||||
|
# Spring Boot Admin Client 客户端的相关配置
|
||||||
|
client:
|
||||||
|
# 设置 Spring Boot Admin Server 地址
|
||||||
|
url: http://localhost:${server.port}${spring.boot.admin.context-path}
|
||||||
|
instance:
|
||||||
|
prefer-ip: true # 注册实例时,优先使用 IP
|
||||||
|
# username: ruoyi
|
||||||
|
# password: 123456
|
||||||
|
# Spring Boot Admin Server 服务端的相关配置
|
||||||
|
context-path: /admin # 配置 Spring
|
||||||
|
|
||||||
|
# Actuator 监控端点的配置项
|
||||||
|
management:
|
||||||
|
endpoints:
|
||||||
|
web:
|
||||||
|
# Actuator 提供的 API 接口的根目录。默认为 /actuator
|
||||||
|
base-path: /actuator
|
||||||
|
exposure:
|
||||||
|
# 需要开放的端点。默认值只打开 health 和 info 两个端点。通过设置 * ,可以开放所有端点。
|
||||||
|
include: '*'
|
||||||
|
endpoint:
|
||||||
|
logfile:
|
||||||
|
external-file: ./logs/sys-console.log
|
@ -49,6 +49,12 @@
|
|||||||
<artifactId>spring-boot-starter-aop</artifactId>
|
<artifactId>spring-boot-starter-aop</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot 校验框架 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 阿里数据库连接池 -->
|
<!-- 阿里数据库连接池 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba</groupId>
|
<groupId>com.alibaba</groupId>
|
||||||
|
@ -6,7 +6,6 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import javax.validation.constraints.*;
|
|
||||||
|
|
||||||
#foreach ($import in $importList)
|
#foreach ($import in $importList)
|
||||||
import ${import};
|
import ${import};
|
||||||
@ -55,11 +54,6 @@ public class ${ClassName}QueryBo extends ${Entity} {
|
|||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
#end
|
#end
|
||||||
@ApiModelProperty("$column.columnComment")
|
@ApiModelProperty("$column.columnComment")
|
||||||
#if($column.javaType == 'String')
|
|
||||||
@NotBlank(message = "$column.columnComment不能为空")
|
|
||||||
#else
|
|
||||||
@NotNull(message = "$column.columnComment不能为空")
|
|
||||||
#end
|
|
||||||
private $column.javaType $column.javaField;
|
private $column.javaType $column.javaField;
|
||||||
#end
|
#end
|
||||||
#end
|
#end
|
||||||
|
@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
<!-- 定时任务 -->
|
<!-- 定时任务 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.quartz-scheduler</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>quartz</artifactId>
|
<artifactId>spring-boot-starter-quartz</artifactId>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<groupId>com.mchange</groupId>
|
<groupId>com.mchange</groupId>
|
||||||
|
@ -1,57 +1,13 @@
|
|||||||
package com.ruoyi.quartz.config;
|
package com.ruoyi.quartz.config;
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.scheduling.quartz.SchedulerFactoryBean;
|
|
||||||
import javax.sql.DataSource;
|
|
||||||
import java.util.Properties;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 定时任务配置
|
* 定时任务配置
|
||||||
*
|
*
|
||||||
* @author ruoyi
|
* @author Lion Li
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class ScheduleConfig
|
public class ScheduleConfig {
|
||||||
{
|
|
||||||
@Bean
|
|
||||||
public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource)
|
|
||||||
{
|
|
||||||
SchedulerFactoryBean factory = new SchedulerFactoryBean();
|
|
||||||
factory.setDataSource(dataSource);
|
|
||||||
|
|
||||||
// quartz参数
|
|
||||||
Properties prop = new Properties();
|
|
||||||
prop.put("org.quartz.scheduler.instanceName", "RuoyiScheduler");
|
|
||||||
prop.put("org.quartz.scheduler.instanceId", "AUTO");
|
|
||||||
// 线程池配置
|
|
||||||
prop.put("org.quartz.threadPool.class", "org.quartz.simpl.SimpleThreadPool");
|
|
||||||
prop.put("org.quartz.threadPool.threadCount", "20");
|
|
||||||
prop.put("org.quartz.threadPool.threadPriority", "5");
|
|
||||||
// JobStore配置
|
|
||||||
prop.put("org.quartz.jobStore.class", "org.quartz.impl.jdbcjobstore.JobStoreTX");
|
|
||||||
// 集群配置
|
|
||||||
prop.put("org.quartz.jobStore.isClustered", "true");
|
|
||||||
prop.put("org.quartz.jobStore.clusterCheckinInterval", "15000");
|
|
||||||
prop.put("org.quartz.jobStore.maxMisfiresToHandleAtATime", "1");
|
|
||||||
prop.put("org.quartz.jobStore.txIsolationLevelSerializable", "true");
|
|
||||||
|
|
||||||
// sqlserver 启用
|
|
||||||
// prop.put("org.quartz.jobStore.selectWithLockSQL", "SELECT * FROM {0}LOCKS UPDLOCK WHERE LOCK_NAME = ?");
|
|
||||||
prop.put("org.quartz.jobStore.misfireThreshold", "12000");
|
|
||||||
prop.put("org.quartz.jobStore.tablePrefix", "QRTZ_");
|
|
||||||
factory.setQuartzProperties(prop);
|
|
||||||
|
|
||||||
factory.setSchedulerName("RuoyiScheduler");
|
|
||||||
// 延时启动
|
|
||||||
factory.setStartupDelay(1);
|
|
||||||
factory.setApplicationContextSchedulerContextKey("applicationContextKey");
|
|
||||||
// 可选,QuartzScheduler
|
|
||||||
// 启动时更新己存在的Job,这样就不用每次修改targetObject后删除qrtz_job_details表对应记录了
|
|
||||||
factory.setOverwriteExistingJobs(true);
|
|
||||||
// 设置自动启动,默认为true
|
|
||||||
factory.setAutoStartup(true);
|
|
||||||
|
|
||||||
return factory;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user