Skip to content
Latchkey

Maven "Non-parseable POM" XML error in CI

Maven could not parse pom.xml as XML. A mismatched tag, stray character, or truncated file makes the model unreadable, and the build fails in the very first phase with the line and column of the syntax error.

What this error means

mvn stops with "Non-parseable POM ...: ... (position: ... line N, column M)", often "must be terminated by the matching end-tag" or "unexpected end of stream".

mvn output
[FATAL] Non-parseable POM /home/runner/work/app/pom.xml:
end tag name </dependencies> must match start tag name <dependency> from line 28
(position: TEXT seen ...</dependencies>... @34:18) @ line 34, column 18 -> [Help 1]

Common causes

Mismatched or unclosed XML tags

A <dependency> or <plugin> block is not closed, or an end tag does not match its start tag, so the XML parser aborts.

A stray character or bad merge

A conflict marker, smart quote, or truncated write left the POM malformed.

How to fix it

Fix the XML at the reported line and column

  1. Open pom.xml at the line/column Maven prints.
  2. Close or correct the mismatched tag, or remove the stray character.
  3. Validate the file as XML before re-running.
Terminal
xmllint --noout pom.xml

Catch malformed POMs in CI early

Run a fast validate step so a broken POM fails before slower goals.

Terminal
mvn -B validate

How to prevent it

  • Lint pom.xml as XML in a pre-commit hook.
  • Resolve merge conflict markers before committing.
  • Run mvn validate as the first CI step.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →