Skip to content

Conversation

@weifly
Copy link

@weifly weifly commented Feb 10, 2026

类库升级情况(对齐springboot4.0.2规定的类库版本):

  1. spring-boot 3.3.2 -> 4.0.2
  2. springframework 6.1.11 -> 7.0.3
  3. mybatis 3.5.16 -> 3.5.19
  4. mybatis-spring 3.0.4 -> 4.0.0
  5. jakarta.persistence-api 3.1.0 -> 3.2.0
  6. slf4j-api 2.0.16 -> 2.0.17
  7. logback-classic 1.5.6 -> 1.5.25

Copy link

Copilot AI left a 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-apislf4j-apimybatislogback 等版本属性
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>
Copy link

Copilot AI Feb 10, 2026

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.

Suggested change
<artifactId>spring-boot-starter-jdbc</artifactId>
<artifactId>spring-boot-starter-jdbc</artifactId>
<optional>true</optional>

Copilot uses AI. Check for mistakes.
Comment on lines +126 to +130
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
<version>${spring-boot.version}</version>
</dependency>
Copy link

Copilot AI Feb 10, 2026

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).

Suggested change
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
<version>${spring-boot.version}</version>
</dependency>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants