Skip to content

Preserve effective POM formatting for colon properties - #437

Merged
slachiewicz merged 1 commit into
apache:masterfrom
efegokdemir:codex/issue-421-effective-pom-format
Oct 27, 2026
Merged

slachiewicz merged 1 commit into
apache:masterfrom
efegokdemir:codex/issue-421-effective-pom-format

Conversation

@efegokdemir

Copy link
Copy Markdown
Contributor

Summary

Fix help:effective-pom formatting when Maven properties contain multiple colons in their names, such as org.mockito:mockito-core:jar.

Changes

  • Temporarily escape namespace-unsafe element names before parsing the generated XML with JDOM.
  • Restore the original property names after pretty-printing so the effective POM content is preserved.
  • Add a regression test covering pretty formatting and duplicate XML declarations.

Fixes #421.

Testing

  • mvn verify
  • git diff --check

All tests passed: 31 tests, with Checkstyle, Spotless, Apache RAT, dependency analysis, and compilation successful on macOS with JDK 21.

Notes

This keeps the existing output property names while allowing the formatter to process the otherwise namespace-invalid names emitted by Maven. AI assistance was used to prepare the patch; the changes and validation were reviewed before submission.

  • Your pull request should address just one issue, without pulling in other changes.
  • Write unit tests that match behavioral changes.
  • Run mvn verify to make sure basic checks pass.

@slachiewicz slachiewicz added the bug Something isn't working label Oct 27, 2026
@slachiewicz
slachiewicz force-pushed the codex/issue-421-effective-pom-format branch from 32de718 to 1d95469 Compare October 27, 2026 20:56
@github-actions

Copy link
Copy Markdown

⚠️ License declaration missing

The pull request description must contain at least one of the following lines with a checked box ([x]):

- [ ] I hereby declare this contribution to be licensed under the [Apache License Version 2.0, January 2004](https://www.apache.org/licenses/LICENSE-2.0)
- [ ] I hereby declare that I have filed an [Apache Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).

This comment will be hidden automatically once the description is fixed.

@slachiewicz
slachiewicz merged commit 897f3d7 into apache:master Oct 27, 2026
18 of 19 checks passed
@github-actions github-actions Bot added this to the 3.5.3 milestone Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

effective-pom duplicate xml declaration and not pretty printed

2 participants