From d34cfe995e457e16ea90079c18328924c1a2a21b Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Thu, 26 Nov 2026 00:01:13 +0800 Subject: [PATCH] =?UTF-8?q?chore(deps):=20=E5=8D=87=E7=BA=A7=20Spring=20Bo?= =?UTF-8?q?ot=204.2.0=20=E4=B8=8E=20Spring=20AI=202.1.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Spring Boot 4.1.2 升到 4.2.0 - Spring AI 2.0.2 升到 2.1.0 - 微信小程序 SDK 升到 4.8.6.B,加密库统一到 1.84 - 固定 swagger 注解包版本,避免被 Spring AI 传递依赖降级 - 新增文档端点能力测试,校验注解包版本与核心方法 - 中间件编排移入部署文档,删除仓库内的 compose 文件 - 版本号升到 4.15.1 --- README.en.md | 7 +- README.md | 7 +- docker-compose.yml | 73 ------------------- pom.xml | 23 ++++-- .../youlai/boot/config/OpenApiDocsTest.java | 47 ++++++++++++ 5 files changed, 69 insertions(+), 88 deletions(-) delete mode 100644 docker-compose.yml create mode 100644 src/test/java/com/youlai/boot/config/OpenApiDocsTest.java diff --git a/README.en.md b/README.en.md index c8d79f01..96915bb9 100644 --- a/README.en.md +++ b/README.en.md @@ -2,9 +2,9 @@ # youlai-boot youlai-boot -**Java 17 + Spring Boot 4.1.2 Enterprise-Grade Permission Management Backend** +**Java 17 + Spring Boot 4.2.0 Enterprise-Grade Permission Management Backend** -[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-4.1.2-6DB33F?logo=spring-boot)](https://spring.io/projects/spring-boot) +[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-4.2.0-6DB33F?logo=spring-boot)](https://spring.io/projects/spring-boot) [![JDK](https://img.shields.io/badge/JDK-17%2B-007396?logo=openjdk)](https://openjdk.org/) [![License](https://img.shields.io/badge/License-Apache%202.0-blue?logo=apache)](LICENSE) [![Gitee Star](https://gitee.com/youlaiorg/youlai-boot/badge/star.svg)](https://gitee.com/youlaiorg/youlai-boot/stargazers) @@ -78,7 +78,7 @@ ## Quick Start -**Requirements**: JDK 17+ · MySQL 8.0+ · Redis 6.0+ +**Requirements**: JDK 17+ · MySQL 8.0+ · Redis 6.0+. Middleware can be started with the Compose file from the deployment guide. 1. Clone the project: @@ -175,7 +175,6 @@ youlai-boot/ │ │ ├── sms/ # SMS service │ │ └── realtime/ # WebSocket communication │ └── system/ # System business (user/role/menu/dept/dict etc.) -├── docker-compose.yml # One-click middleware orchestration (MySQL/Redis/RustFS/Xxl-Job) └── pom.xml # Maven dependency management ``` diff --git a/README.md b/README.md index 395eb1cc..13d30f83 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ # youlai-boot youlai-boot -**Java 17 + Spring Boot 4.1.2 企业级权限管理系统后端** +**Java 17 + Spring Boot 4.2.0 企业级权限管理系统后端** -[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-4.1.2-6DB33F?logo=spring-boot)](https://spring.io/projects/spring-boot) +[![Spring Boot](https://img.shields.io/badge/Spring%20Boot-4.2.0-6DB33F?logo=spring-boot)](https://spring.io/projects/spring-boot) [![JDK](https://img.shields.io/badge/JDK-17%2B-007396?logo=openjdk)](https://openjdk.org/) [![License](https://img.shields.io/badge/License-Apache%202.0-blue?logo=apache)](LICENSE) [![Gitee Star](https://gitee.com/youlaiorg/youlai-boot/badge/star.svg)](https://gitee.com/youlaiorg/youlai-boot/stargazers) @@ -78,7 +78,7 @@ ## 快速开始 -**环境要求**:JDK 17+ · MySQL 8.0+ · Redis 6.0+ +**环境要求**:JDK 17+ · MySQL 8.0+ · Redis 6.0+。中间件可用[部署运维](https://www.youlai.tech/docs/server/spring-boot/deploy.html)里的 compose 编排一键启动。 1. 克隆项目: @@ -161,7 +161,6 @@ youlai-boot/ │ │ ├── sms/ # 短信服务 │ │ └── realtime/ # WebSocket 实时通信 │ └── system/ # 系统业务(用户/角色/菜单/部门/字典等) -├── docker-compose.yml # 中间件一键编排(MySQL/Redis/RustFS/Xxl-Job) └── pom.xml # Maven 依赖管理 ``` diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 82d78484..00000000 --- a/docker-compose.yml +++ /dev/null @@ -1,73 +0,0 @@ -# Docker Compose 一键安装中间件 MySQL、Redis、RustFS、Xxl-Job -# -# 安装:docker compose up -d -# 卸载:docker compose down(加 -v 同时删除数据卷) -# -# 说明: -# - name 固定项目名,容器统一管理和卸载,避免与其他项目冲突 -# - 中间件配置全部内联于 command 参数,无需外部配置文件 -# - 数据持久化使用命名卷(docker volume 统一管理),不污染项目目录 -# - 对象存储使用 RustFS(S3 协议兼容) - -name: youlai-boot - -services: - mysql: - image: mysql:8.0.29 - container_name: mysql - restart: unless-stopped - # 等价于原 my.cnf 的 utf8mb4 字符集设置(MySQL 8 其余项与默认值一致) - command: --character-set-server=utf8mb4 --collation-server=utf8mb4_0900_ai_ci - environment: - - TZ=Asia/Shanghai - - LANG=en_US.UTF-8 - - MYSQL_ROOT_PASSWORD=123456 - volumes: - - youlai-mysql-data:/var/lib/mysql - ports: - - 3306:3306 - - redis: - image: redis:7.2.3 - container_name: redis - restart: unless-stopped - # --protected-mode no 允许远程连接(原 redis.conf 唯一非默认项) - command: redis-server --requirepass 123456 --appendonly no --protected-mode no - environment: - - TZ=Asia/Shanghai - volumes: - - youlai-redis-data:/data - ports: - - 6379:6379 - - rustfs: - image: rustfs/rustfs:latest - container_name: rustfs - restart: unless-stopped - environment: - - TZ=Asia/Shanghai - - LANG=en_US.UTF-8 - - RUSTFS_ACCESS_KEY=rustfs-admin - - RUSTFS_SECRET_KEY=rustfs-admin - volumes: - - youlai-rustfs-data:/data - ports: - - 9000:9000 - - 9001:9001 - - xxl-job-admin: - image: xuxueli/xxl-job-admin:3.4.2 - container_name: xxl-job-admin - restart: unless-stopped - environment: - PARAMS: '--spring.datasource.url=jdbc:mysql://mysql:3306/xxl_job?useUnicode=true&characterEncoding=UTF-8&autoReconnect=true&serverTimezone=Asia/Shanghai --spring.datasource.username=root --spring.datasource.password=123456 --spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver' - volumes: - - youlai-xxljob-logs:/data/applogs - ports: - - 8080:8080 - -volumes: - youlai-mysql-data: - youlai-redis-data: - youlai-rustfs-data: - youlai-xxljob-logs: diff --git a/pom.xml b/pom.xml index 3b30b061..ede1e4e7 100644 --- a/pom.xml +++ b/pom.xml @@ -6,13 +6,13 @@ com.youlai youlai-boot - 4.15.0 + 4.15.1 基于 Java 17 + SpringBoot 4 + Spring Security 构建的权限管理系统。 org.springframework.boot spring-boot-starter-parent - 4.1.2 + 4.2.0 @@ -66,15 +66,18 @@ 1.3.0 - 4.8.1.B + 4.8.6.B - 2.0.2 + + 1.84 - + 2.1.0 + + 2.2.55 - 0.4.0 + 0.3.3 @@ -87,7 +90,7 @@ pom import - + io.swagger.core.v3 swagger-annotations @@ -98,6 +101,12 @@ swagger-annotations-jakarta ${swagger.version} + + + org.bouncycastle + bcprov-jdk18on + ${bouncycastle.version} + diff --git a/src/test/java/com/youlai/boot/config/OpenApiDocsTest.java b/src/test/java/com/youlai/boot/config/OpenApiDocsTest.java new file mode 100644 index 00000000..724fce00 --- /dev/null +++ b/src/test/java/com/youlai/boot/config/OpenApiDocsTest.java @@ -0,0 +1,47 @@ +package com.youlai.boot.config; + +import io.swagger.v3.oas.annotations.media.Schema; +import org.junit.jupiter.api.Test; + +import java.lang.reflect.Method; +import java.net.URL; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static org.assertj.core.api.Assertions.assertThat; + +/** + * 文档端点能力测试 + * + * 注解包版本被依赖降级后,编译和其它单测都不会报错,只有打开文档页时才会失败 + * + * @author Ray.Hao + * @since 4.15.0 + */ +class OpenApiDocsTest { + + // 文档页需要这个方法,注解包版本偏低时这里会失败 + @Test + void swaggerAnnotationsProvideDynamicRef() { + assertThat(Schema.class.getMethods()) + .extracting(Method::getName) + .contains("$dynamicRef"); + } + + // 两个包版本必须一致,混用会让文档页加载失败 + @Test + void swaggerAnnotationsVersionMatchesCore() { + String annotations = jarVersion(Schema.class); + String core = jarVersion(io.swagger.v3.core.util.Json.class); + assertThat(annotations).as("swagger-annotations 版本").isNotBlank(); + assertThat(core).as("swagger-core 版本").isNotBlank(); + assertThat(annotations).as("注解包与 core 版本").isEqualTo(core); + } + + private static String jarVersion(Class type) { + URL location = type.getProtectionDomain().getCodeSource().getLocation(); + String fileName = location.getPath().substring(location.getPath().lastIndexOf('/') + 1); + Matcher matcher = Pattern.compile("-(\\d+\\.\\d+\\.\\d+)\\.jar$").matcher(fileName); + return matcher.find() ? matcher.group(1) : ""; + } +}