Skip to content

修复:移除 dependencyManagement 中 joda-time 的 test scope,防止覆盖下游项目依赖范围#4016

Merged
binarywang merged 3 commits into
developfrom
copilot/fix-joda-time-dependency-issue
May 23, 2026
Merged

修复:移除 dependencyManagement 中 joda-time 的 test scope,防止覆盖下游项目依赖范围#4016
binarywang merged 3 commits into
developfrom
copilot/fix-joda-time-dependency-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 23, 2026

在根 pom.xmldependencyManagement 中,joda-time 被标记为 scope=test。当下游项目(如 Spring Boot 4 / Spring Cloud 2025.1 微服务)通过 BOM 方式引入 WxJava 时,该 scope 会覆盖下游项目自身对 joda-time 的依赖声明,导致其在运行时不可用。

变更

  • pom.xml:将 joda-time 从"测试所用依赖"注释块中移出,去除 <scope>test</scope>,仅保留版本管理。
<!-- 修复前 -->
<!-- 测试所用依赖 -->
<dependency>
  <groupId>joda-time</groupId>
  <artifactId>joda-time</artifactId>
  <version>2.10.6</version>
  <scope>test</scope>  <!-- 会污染下游项目 -->
</dependency>

<!-- 修复后 -->
<dependency>
  <groupId>joda-time</groupId>
  <artifactId>joda-time</artifactId>
  <version>2.10.6</version>
</dependency>

各子模块(weixin-java-mpweixin-java-miniappweixin-java-openweixin-java-qidian)在自身 <dependencies> 中已显式声明 scope=test,行为不受影响。dependencyManagement 应仅管理版本,不应约束 scope。

Copilot AI changed the title [WIP] Fix joda-time dependency being overridden in springboot4 修复:移除 dependencyManagement 中 joda-time 的 test scope,防止覆盖下游项目依赖范围 May 23, 2026
Copilot AI requested a review from binarywang May 23, 2026 12:50
@binarywang binarywang marked this pull request as ready for review May 23, 2026 12:53
Copilot AI review requested due to automatic review settings May 23, 2026 12:53
Copy link
Copy Markdown

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 修复了根 pom.xmldependencyManagement 中对 joda-time 误设为 scope=test 的问题,避免 WxJava 作为 BOM 被下游项目导入时覆盖其 joda-time 依赖范围,从而导致运行时不可用。

Changes:

  • 在根 pom.xmldependencyManagement 中移除 joda-time<scope>test</scope>,仅保留版本管理。
  • 调整“测试所用依赖”注释块的位置,使其继续覆盖后续测试依赖(如 logback、testng 等)。

Comment thread pom.xml
Agent-Logs-Url: https://github.com/binarywang/WxJava/sessions/e8790097-f42d-4742-930f-3dc3b3f99d23

Co-authored-by: binarywang <1343140+binarywang@users.noreply.github.com>
@binarywang binarywang merged commit 388478e into develop May 23, 2026
1 check passed
@binarywang binarywang deleted the copilot/fix-joda-time-dependency-issue branch May 23, 2026 14:55
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.

springboot4 springcloud2025.1版本joda-time依赖被覆盖

3 participants