Skip to content

XML attributes stripped from pom.xml during version bump #268

@rodrigobavwork-spec

Description

@rodrigobavwork-spec

Describe the bug
Version 12.6.1 corrupts Maven POM files by stripping XML attributes.

Current behavior
When commit-and-tag-version@12.6.1 processes a Maven pom.xml file, its seen stripping XML attributes from elements. All attributes (taskname, dir, fork, failonerror, classname, refid, value) and their values are completely removed, making the Maven configuration invalid. For example on a maven antrun plugin configuration:

Before commit-and-tag-version

<java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" classname="com.pinterest.ktlint.Main">
  <classpath refid="maven.plugin.classpath"/>
  <arg value="src/**/*.kt"/>
</java>

After commit-and-tag-version

<java>
  <classpath></classpath>
  <arg></arg>
</java>

Expected behavior
XML should remain intact and valid after commit-and-tag-version

Environment

  • commit-and-tag-version version(s): 12.6.1
  • Node/npm version: Node.js v22.13.1 / npm 10.9.2
  • OS: macOS Tahoe 26.1

Additional context

  • The issue is reproducible with npx commit-and-tag-version --skip.commit --skip.tag
  • confirmed via isolated testing that fast-xml-parser itself preserves attributes correctly, indicating the bug is in commit-and-tag-version's usage/configuration of the parser

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions