{"record":{"id":"32458add19fa3fde","repo":"apache/maven","slug":"problem-during-inlining-pom","errorCode":null,"errorMessage":"Problem during inlining POM","messagePattern":"Problem during inlining POM","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/PomInlinerTransformer.java","lineNumber":140,"sourceCode":"                if (version == null && model.getParent() != null) {\n                    version = model.getParent().getVersion();\n                }\n                String newVersion;\n                if (version != null) {\n                    HashSet<String> usedProperties = new HashSet<>();\n                    newVersion = interpolator.interpolate(version.trim(), property -> {\n                        if (!session.getConfigProperties().containsKey(property)) {\n                            throw new IllegalArgumentException(\"Cannot inline property \" + property);\n                        }\n                        usedProperties.add(property);\n                        return (String) session.getConfigProperties().get(property);\n                    });\n                    if (!Objects.equals(version, newVersion)) {\n                        needsInlining(session).addAll(usedProperties);\n                    }\n                }\n            } catch (XMLStreamException e) {\n                throw new IOException(\"Problem during inlining POM\", e);\n            }\n        }\n    }\n}\n","sourceCodeStart":122,"sourceCodeEnd":145,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/PomInlinerTransformer.java#L122-L145","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"<!-- before: pom.xml with an unclosed tag -->\n<dependency>\n  <groupId>org.acme</groupId>\n  <artifactId>lib</artifactId>\n\n<!-- after -->\n<dependency>\n  <groupId>org.acme</groupId>\n  <artifactId>lib</artifactId>\n</dependency>","handlingStrategy":"try-catch","validationCode":"// pre-parse the POM before running the pipeline\ntry (XMLInputFactory f = XMLInputFactory.newInstance(); var r = f.createXMLStreamReader(Files.newInputStream(pom))) {\n    while (r.hasNext()) r.next(); // throws on malformed XML\n}","typeGuard":null,"tryCatchPattern":"catch (IOException e) {\n    if (\"Problem during inlining POM\".equals(e.getMessage()) && e.getCause() instanceof XMLStreamException xse) {\n        // fix pom.xml at the location reported by xse.getLocation()\n    }\n}","preventionTips":["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"],"tags":["maven","xml","pom-parse","io","wrapper-exception"],"backgroundTag":"malformed-pom-xml","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}