Skip to content

Conversation

@ZiySir
Copy link

@ZiySir ZiySir commented Nov 21, 2025

Before this PR

Gradle 9 已正式移除 groovy.util.XmlParsergroovy.util.Node 等旧的 XML 解析类。
当前代码仍依赖这些被移除的类,导致在 Gradle 9 环境下出现 ClassNotFoundException,无法完成编译与构建。

因此必须迁移到 Groovy 4+ 提供的现代命名空间 groovy.xml.*

After this PR

该 PR 完成以下内容:

  • 将所有 groovy.util.XmlParsergroovy.util.Nodegroovy.util.NodeList 等引用迁移为 groovy.xml.*
  • 不改变任何解析逻辑或功能,仅替换包路径。
  • 确保项目能够在 Gradle 9 + Groovy 4 环境下正常构建与运行。
  • 保证向前兼容 Groovy 4 的 API,无行为变更。

==COMMIT_MSG==
Migrate deprecated XML classes for Gradle 9 compatibility

Gradle 9 removes legacy Groovy XML classes under groovy.util.*.
This commit replaces:

  • groovy.util.XmlParsergroovy.xml.XmlParser
  • groovy.util.Nodegroovy.xml.Node
  • groovy.util.NodeListgroovy.xml.NodeList

No functional changes. Ensures the project builds successfully on Gradle 9 / Groovy 4.
==COMMIT_MSG==

Possible downsides?

  • 如果有外部依赖仍显式引用 groovy.util.XmlParser,可能需要一起升级。
  • 项目运行环境必须基于 Groovy 4+;否则新版包路径不可用。
  • 理论上无行为变更,但若使用反射访问旧包路径,需同步调整。

@changelog-app
Copy link

changelog-app bot commented Nov 21, 2025

Generate changelog in changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

Migrate deprecated XML classes for Gradle 9 compatibility

Gradle 9 removes legacy Groovy XML classes under groovy.util.*.
This commit replaces:

  • groovy.util.XmlParsergroovy.xml.XmlParser
  • groovy.util.Nodegroovy.xml.Node
  • groovy.util.NodeListgroovy.xml.NodeList

No functional changes. Ensures the project builds successfully on Gradle 9 / Groovy 4.

Check the box to generate changelog(s)

  • Generate changelog entry

@ZiySir
Copy link
Author

ZiySir commented Nov 21, 2025

Generate changelog in changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description Migrate deprecated XML classes for Gradle 9 compatibility

Gradle 9 removes legacy Groovy XML classes under groovy.util.*. This commit replaces:

  • groovy.util.XmlParsergroovy.xml.XmlParser
  • groovy.util.Nodegroovy.xml.Node
  • groovy.util.NodeListgroovy.xml.NodeList

No functional changes. Ensures the project builds successfully on Gradle 9 / Groovy 4.

Check the box to generate changelog(s)

  • Generate changelog entry

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