-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
适配 spring-boot 4.0.2 #948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
适配 spring-boot 4.0.2 #948
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
该 PR 旨在将项目相关模块对齐到 Spring Boot 4.0.2 / Spring Framework 7.0.3 的依赖版本体系,并修复随之而来的少量 Spring Boot API/包名变更带来的编译适配问题。
Changes:
- 升级 Spring / Spring Boot / MyBatis / Jakarta Persistence / SLF4J / Logback 等关键依赖版本属性
- 适配 Spring Boot 中
DataSourceAutoConfiguration的包名变更 - 调整
PropertyMapper的使用方式以兼容新版 Spring Boot API
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
pom.xml |
升级 jakarta.persistence-api、slf4j-api、mybatis、logback 等版本属性 |
spring/pom.xml |
升级 Spring Framework 与 mybatis-spring 版本属性 |
spring-boot-starter/pom.xml |
升级 Spring Boot 与 mybatis-spring 版本属性;新增 JDBC starter 的依赖管理条目 |
spring-boot-starter/mapper-spring-boot-autoconfigure/pom.xml |
新增对 spring-boot-starter-jdbc 的依赖 |
.../MybatisProperties.java |
更新 PropertyMapper 初始化方式以兼容新版 API |
.../MapperAutoConfiguration.java |
更新 DataSourceAutoConfiguration 的 import 包路径以适配新版 Spring Boot |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </dependency> | ||
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-jdbc</artifactId> |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mapper-spring-boot-autoconfigure is an auto-config library module and most of its dependencies are marked optional. Adding spring-boot-starter-jdbc here as a non-optional dependency will pull in the full JDBC starter transitively (including connection pool, etc.) for anyone depending on the autoconfigure artifact directly, which is typically undesirable for an autoconfigure module. Consider depending on the minimal required Boot JDBC auto-config artifact instead (or at least mark this dependency as optional) and keep the heavy starter dependency only in the *-starter module.
| <artifactId>spring-boot-starter-jdbc</artifactId> | |
| <artifactId>spring-boot-starter-jdbc</artifactId> | |
| <optional>true</optional> |
| <dependency> | ||
| <groupId>org.springframework.boot</groupId> | ||
| <artifactId>spring-boot-starter-jdbc</artifactId> | ||
| <version>${spring-boot.version}</version> | ||
| </dependency> |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This parent POM already imports spring-boot-dependencies (BOM), which manages the versions for Boot starters. Adding spring-boot-starter-jdbc to dependencyManagement with an explicit version is redundant and can make future upgrades/overrides harder to reason about. Consider removing this dependencyManagement entry and rely on the imported BOM (keep the dependency declaration in the actual starter module if needed).
| <dependency> | |
| <groupId>org.springframework.boot</groupId> | |
| <artifactId>spring-boot-starter-jdbc</artifactId> | |
| <version>${spring-boot.version}</version> | |
| </dependency> |
类库升级情况(对齐springboot4.0.2规定的类库版本):