Skip to content

build: Spring Boot 2.7.18 补丁升级(修复 htmlunit / spring-boot-devtools / json-lib 告警) - #12

Merged
Ruffianjiang merged 1 commit into
masterfrom
fix/spring-boot-2.7.18-patch
Aug 20, 2026
Merged

build: Spring Boot 2.7.18 补丁升级(修复 htmlunit / spring-boot-devtools / json-lib 告警)#12
Ruffianjiang merged 1 commit into
masterfrom
fix/spring-boot-2.7.18-patch

Conversation

@Ruffianjiang

@Ruffianjiang Ruffianjiang commented Aug 20, 2026

Copy link
Copy Markdown
Owner

背景

java4fun 当前存在以下 Dependabot 安全告警,本 PR 在 Spring Boot 2.7.x 范围内做补丁升级,以真正消除这些告警(不跨大版本):

本 PR 替代并关闭原 #11#11spring.boot.version 误升到 4.1.0,与项目 java.version=1.8 不兼容,会导致构建失败,因此不应合并。

变更内容

1. 根 pom.xml

  • spring.boot.version2.7.32.7.18(2.7.x 最新补丁版,修复 devtools 高危漏洞)
  • java.versionmaven.compiler.source/target1.811
    • 原因:htmlunit 3.x 最低要求 Java 11,为修复严重漏洞必须升级;Spring Boot 2.7.18 仍支持 Java 8–19,本次升级保持在 2.7.x 内。

2. 三个模块 pom.xml(banner / img2text / html2md)

  • spring-boot-devtools:去掉显式 2.7.3 版本号,统一改由根 BOM(2.7.18)管理,修复高危漏洞(banner、img2text 此前显式钉死 2.7.3,不会随 BOM 升级,故需一并处理)。
  • 各模块中 spring-boot-starter / spring-boot-starter-test 等 Spring Boot 构件去掉显式 2.7.3 版本号,统一由 BOM 管理(保持 2.7.18 一致)。
  • banner / img2textjava.version1.8 调整为 11,与根工程一致。
  • html2md 额外变更:
    • htmlunit:net.sourceforge.htmlunit:htmlunit:2.64.0org.htmlunit:htmlunit:3.11.0(groupId/包名随 3.x 变更,修复严重漏洞)
    • 移除 json-lib 依赖(改用 Jackson,见下)
    • maven-compiler-plugin:source/target 1.811

3. 源码

  • 4 个文件(BaiduCrawlerUrl.javaInnotreeService.javaTest.javatest2.java)将 com.gargoylesoftware.htmlunit 包名重命名为 org.htmlunit:htmlunit 3.x 仅包名变化,API 完全兼容,属纯重命名。
  • WebLogAspect.javaInnotreeService.java:将 net.sf.json(JSONObject / JSONArray)替换为 Jackson(com.fasterxml.jackson.databindspring-boot-starter-web 已自带,无需新增依赖),移除 json-lib 依赖以修复中危漏洞。

验证建议

  • 构建需 JDK 11+maven.test.skip=true 已开启,跳过测试)。
  • 受影响模块 html2md 已同步将编译器目标调整为 Java 11。

关联

@Ruffianjiang
Ruffianjiang force-pushed the fix/spring-boot-2.7.18-patch branch 3 times, most recently from 1f8e256 to a18294d Compare August 20, 2026 04:21
@Ruffianjiang
Ruffianjiang force-pushed the fix/spring-boot-2.7.18-patch branch from 11dd9eb to 7c55be8 Compare August 20, 2026 06:11
@Ruffianjiang
Ruffianjiang merged commit 0bfd4c2 into master Aug 20, 2026
4 checks passed
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.

1 participant