Gradle 7.5.1 ---> 8.5 intellij idea 2022.1 ---> 2023.3.2 Springboot 2.5.14 ---> 3.1.17 Lombok 1.18.24 ---> 1.18.30 hutool-all 5.1.1 ---> 5.8.23 springfox-swagger2 ---> springdoc 2.3.0 fastjson、fastjson2 ---> 2.0.45 dubbo 2.4.9 ---> 2.6.9 druid 1.2.16 ---> 1.2.21
Unsupported Java. Your build is currently configured to use Java 21.0.1 and Gradle 7.5.1. Possible solution: - Use Java 18 as Gradle JVM: Open Gradle settings - Upgrade Gradle wrapper to 8.5 version and re-import the project
id 'org.springframework.boot' version '3.1.7' id 'io.spring.dependency-management' version '1.1.4'
Class com.sun.tools.javac.tree.JCTree$JCImport does not have member field ‘com.sun.tools.javac.tree.JCTree qualid’
处理:lombok版本兼容性的问题 :依赖更新新版 lombok 为 1.18.30 即可
compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.30' annotationProcessor group: 'org.projectlombok', name: 'lombok', version: '1.18.30'
错误: 找不到符号import javax.annotation.Resource; 错误: 程序包javax.servlet.http不存在import javax.servlet.http.HttpServletRequest;
处理新包路径引入
import jakarta.annotation.Resource; import jakarta.servlet.http.HttpServletRequest;
//去除logback implementation.exclude group: 'ch.qos.logback'
cn.hutool:hutool-all 5.1.1 升级至5.8.23
文档:https://springdoc.org/index.html#javadoc-support
//补充javax 依赖 implementation 'javax.servlet:javax.servlet-api:4.0.1'
应用主类添加注解@EnableOpenApi (swagger2是@EnableSwagger2)
swagger配置类SwaggerProperties.class,与swagger2.xx 版本有差异,具体看下文
自定义一个配置类 SwaggerConfiguration.class,看下文
访问地址:http://localhost:8080/swagger-ui/index.html
(swagger2.xx版本访问的地址为http://localhost:8080/swagger-ui.html)
//替换为springdoc implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
implementation "com.alibaba:fastjson:2.0.45" implementation "com.alibaba.fastjson2:fastjson2:2.0.45"
implementation(group: 'com.alibaba', name: 'dubbo', version:'2.6.9')
// job implementation(group: 'com.nxin.framework', name: 'job-center-client', version: '1.1.15') implementation(group: 'com.nxin.framework', name: 'job-center-core', version: '1.1.15')
implementation 'com.alibaba:druid-spring-boot-starter:1.2.21' implementation group: 'com.alibaba', name: 'druid', version:"$druidVersion"
#redis配置 spring.data.redis.host = ${redis} spring.data.redis.port = 6379 spring.data.redis.password = ****** spring.data.redis.database = 12 spring.data.redis.timeout = 60000 spring.data.redis.lettuce.pool.max-wait = 30000 spring.data.redis.lettuce.pool.max-idle = 10 spring.data.redis.lettuce.pool.max-active = 10
// runtimeOnly 'mysql:mysql-connector-java:8.0.33' runtimeOnly 'com.mysql:mysql-connector-j'
上一篇:MySQL用心总结