apache/maven · error · IOException
Problem during inlining POM
Error message
Problem during inlining POM
What it means
A wrapper IOException thrown by PomInlinerTransformer when streaming-parsing the raw pom.xml fails with an XMLStreamException. The root cause (line/column and XML error) is attached; it means the file being read as XML is malformed at the point read() stopped.
Source
Thrown at impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/PomInlinerTransformer.java:140
if (version == null && model.getParent() != null) {
version = model.getParent().getVersion();
}
String newVersion;
if (version != null) {
HashSet<String> usedProperties = new HashSet<>();
newVersion = interpolator.interpolate(version.trim(), property -> {
if (!session.getConfigProperties().containsKey(property)) {
throw new IllegalArgumentException("Cannot inline property " + property);
}
usedProperties.add(property);
return (String) session.getConfigProperties().get(property);
});
if (!Objects.equals(version, newVersion)) {
needsInlining(session).addAll(usedProperties);
}
}
} catch (XMLStreamException e) {
throw new IOException("Problem during inlining POM", e);
}
}
}
}
View on GitHub (pinned to e4093d4e12)
Solutions
- Open the cause chain: the nested XMLStreamException names the line and column of the XML error — fix pom.xml there
- Check for merge-conflict markers (<<<<<<< / >>>>>>>) if the file came out of a failed merge
- Validate the file in an editor/IDE XML parser before rebuilding
- Ensure the file encoding matches the XML declaration
Example fix
<!-- before: pom.xml with an unclosed tag --> <dependency> <groupId>org.acme</groupId> <artifactId>lib</artifactId> <!-- after --> <dependency> <groupId>org.acme</groupId> <artifactId>lib</artifactId> </dependency>
Defensive patterns
Strategy: try-catch
Validate before calling
// pre-parse the POM before running the pipeline
try (XMLInputFactory f = XMLInputFactory.newInstance(); var r = f.createXMLStreamReader(Files.newInputStream(pom))) {
while (r.hasNext()) r.next(); // throws on malformed XML
} Try / catch
catch (IOException e) {
if ("Problem during inlining POM".equals(e.getMessage()) && e.getCause() instanceof XMLStreamException xse) {
// fix pom.xml at the location reported by xse.getLocation()
}
} Prevention
- Keep pom.xml out of merge conflicts or resolve them fully before building
- Validate XML in a pre-commit hook or CI lint step
- Watch for encoding mismatches when files move between Windows/Linux
When it happens
Trigger: install/deploy (with consumer POM off) on a project whose pom.xml contains malformed XML: unclosed tags, stray characters, wrong encoding declaration, or a file truncated by a merge conflict. read(project.getFile().toPath()) throws XMLStreamException, which is caught and rethrown as IOException('Problem during inlining POM', e).
Common situations: Unresolved git merge conflicts left conflict markers in pom.xml; hand-editing the POM and breaking a tag; encoding mismatch (BOM/UTF-16 vs declared UTF-8); CI cache writing a partial file.
Related errors
- Unable to write model:
- Unable to write plugin:
- Unable to write settings: {}
- Unable to write toolchains: {}
- Cannot read metadata from '{}': {}
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/32458add19fa3fde.
Report an issue: GitHub.