Skip to content

Commit

Permalink
升级springboot3.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoutaoo committed Feb 26, 2024
1 parent 02ab5d2 commit e6fc69b
Show file tree
Hide file tree
Showing 22 changed files with 67 additions and 59 deletions.
51 changes: 31 additions & 20 deletions opensabre-base-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,30 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<!-- 编译 -->
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<lombok.version>1.18.24</lombok.version>
<spring-boot-maven-plugin.version>2.7.5</spring-boot-maven-plugin.version>
<dockerfile-maven-plugin.version>1.4.13</dockerfile-maven-plugin.version>
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
<!-- 依赖 -->
<spring.boot.version>2.7.18</spring.boot.version>
<spring.cloud.version>2021.0.9</spring.cloud.version>
<spring.boot.version>3.2.3</spring.boot.version>
<spring.cloud.version>2023.0.0</spring.cloud.version>
<spring.cloud.alibaba.version>2021.0.5.0</spring.cloud.alibaba.version>
<spring-boot-starter-data-redis.version>2.7.18</spring-boot-starter-data-redis.version>
<jetcache-starter-redis.version>2.7.5</jetcache-starter-redis.version>
<springdoc-openapi-ui.version>1.6.12</springdoc-openapi-ui.version>
<swagger-annotations.version>2.2.4</swagger-annotations.version>
<springdoc-openapi-ui.version>2.3.0</springdoc-openapi-ui.version>
<swagger-annotations.version>2.2.20</swagger-annotations.version>
<mysql-connector-j.version>8.0.31</mysql-connector-j.version>
<javax.servlet-api.version>3.1.0</javax.servlet-api.version>
<mybatis-plus-boot-starter.version>3.5.2</mybatis-plus-boot-starter.version>
<mybatis-spring.version>2.0.7</mybatis-spring.version>
<commons-pool2.version>2.11.1</commons-pool2.version>
<commons-lang3.version>3.12.0</commons-lang3.version>
<jakarta.servlet-api.version>6.0.0</jakarta.servlet-api.version>
<mybatis-plus-boot-starter.version>3.5.5</mybatis-plus-boot-starter.version>
<mybatis-spring.version>3.0.3</mybatis-spring.version>
<hutool.version>5.8.18</hutool.version>
<spring-webmvc.version>5.3.31</spring-webmvc.version>
<feign-interceptors>1.1.2</feign-interceptors>
<guava.version>31.1-jre</guava.version>
<jackson-databind.version>2.13.5</jackson-databind.version>
<jackson-annotations.version>2.13.5</jackson-annotations.version>
<jasypt-springboot.version>3.0.5</jasypt-springboot.version>
<!-- 测试 -->
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<spring-test.version>5.3.31</spring-test.version>
<spring-boot-starter-test.version>2.7.18</spring-boot-starter-test.version>
<httpclient5.version>5.2.3</httpclient5.version>
</properties>

Expand Down Expand Up @@ -94,9 +88,9 @@
</dependency>
<!-- WEB -->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>${javax.servlet-api.version}</version>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${jakarta.servlet-api.version}</version>
<scope>provided</scope>
</dependency>
<!-- 负载组件 -->
Expand All @@ -119,7 +113,7 @@
<!--springdoc - restfull API文档-->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
<version>${springdoc-openapi-ui.version}</version>
</dependency>
<!--opensabre 组件-->
Expand Down Expand Up @@ -227,6 +221,14 @@
<!--依赖插件版本定义-->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<parameters>true</parameters>
</configuration>
</plugin>
<!--springboot官方构建插件,可构建docker image-->
<plugin>
<groupId>org.springframework.boot</groupId>
Expand Down Expand Up @@ -273,5 +275,14 @@
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgs>--enable-preview</compilerArgs>
</configuration>
</plugin>
</plugins>
</build>
</project>
6 changes: 3 additions & 3 deletions opensabre-starter-boot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
</dependency>
<!-- 分布式链路追踪 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-sleuth</artifactId>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-tracing-bridge-otel</artifactId>
</dependency>
<!-- 表单校验-->
<dependency>
Expand All @@ -64,7 +64,7 @@
<!--springdoc - restfull API文档-->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
</dependency>
<!-- 提示文件生成 -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

import javax.annotation.Resource;
import jakarta.annotation.Resource;

/**
* Swagger配置类
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

import javax.annotation.Resource;
import jakarta.annotation.Resource;

@Slf4j
public class OpensabreSensitiveDesensitizerProcessor implements BeanPostProcessor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;

import javax.annotation.Resource;
import jakarta.annotation.Resource;

/**
* springboot应用启动完成后,发送Rest注册事件
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

import javax.annotation.Resource;
import jakarta.annotation.Resource;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;

import javax.annotation.PostConstruct;
import jakarta.annotation.PostConstruct;
import java.util.Arrays;
import java.util.LinkedHashSet;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#==============日志===============#
logging.level.io.github.opensabre=info
logging.logback.rollingpolicy.max-file-size=1GB
logging.file.path=logs/
logging.file.path=logs
logging.pattern.level=%5p [${spring.application.name},%X{traceId:-},%X{spanId:-}]
9 changes: 4 additions & 5 deletions opensabre-starter-boot/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,12 @@
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/opensabre-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<!-- 日志文件大小 -->
<maxFileSize>100MB</maxFileSize>
<!-- 日志文档保留天数 -->
<maxHistory>15</maxHistory>
</rollingPolicy>
</appender>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import javax.annotation.Resource;
import jakarta.annotation.Resource;

import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down
7 changes: 1 addition & 6 deletions opensabre-starter-boot/src/test/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ spring:
bus:
trace:
enabled: true
sleuth:
sampler:
probability: 1.0
mvc:
throw-exception-if-no-handler-found: true
format:
date-time: yyyy-MM-dd HH:mm:ss
date: yyyy-MM-dd
Expand Down Expand Up @@ -44,5 +39,5 @@ logging:
rollingpolicy:
max-file-size: 1GB
file:
path: logs/
path: logs
config: classpath:logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ spring:
discovery:
server-addr: ${REGISTER_HOST:localhost}:${REGISTER_PORT:8848}
watch:
enabled: true
enabled: false
enabled: true
cluster-name: CLUSTER-${CLOUD_AZ:LOCAL} # 取环境变量AZ做为部分集群名:CLUSTER-SH,无环境变量默认为CLUSTER-LOCAL代表本地开发实例
4 changes: 2 additions & 2 deletions opensabre-starter-rpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
</dependency>
<!--web开发相关-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;
import java.util.Enumeration;
import java.util.Map;

Expand Down
4 changes: 2 additions & 2 deletions opensabre-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@
</dependency>
<!--开发相关-->
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<scope>provided</scope>
</dependency>
<!--测试框架-->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

import com.fasterxml.jackson.databind.ObjectMapper;
import io.github.opensabre.common.core.util.UserContextHolder;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.lang.Nullable;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import java.util.Map;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.springframework.web.bind.annotation.RestControllerAdvice;
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;

import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.NotNull;

/**
* Rest统一返回报文封装,在rest方法返回后送给客户端前执行
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package io.github.opensabre.common.web.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.Repeatable;
import java.lang.annotation.Retention;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.apache.commons.lang3.StringUtils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import java.util.Arrays;
import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package io.github.opensabre.common.web.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.apache.commons.lang3.StringUtils;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import java.util.regex.Pattern;

/**
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>

<revision>0.0.9</revision>
<revision>0.1.0</revision>
</properties>

<!--发布仓库的定义-->
Expand Down

0 comments on commit e6fc69b

Please sign in to comment.