apache/maven · error · MavenException
Unable to parse xml: {} {}
Error message
Unable to parse xml: {}
{} What it means
Error "Unable to parse xml: {} {}" thrown in apache/maven.
Source
Thrown at impl/maven-testing/src/main/java/org/apache/maven/testing/plugin/MojoExtension.java:291
.findFirst()
.map(ConfigurationContainer::getConfiguration)
.orElseGet(() -> XmlNode.newInstance("config"));
List<XmlNode> children = mojoParameters.stream()
.map(mp -> {
String value = mp.value();
if (!mp.xml()) {
// Treat as plain text - escape XML special characters
value = value.replace("&", "&")
.replace("<", "<")
.replace(">", ">")
.replace("\"", """)
.replace("'", "'");
}
String s = '<' + mp.name() + '>' + value + "</" + mp.name() + '>';
try {
return XmlService.read(new StringReader(s));
} catch (XMLStreamException e) {
throw new MavenException("Unable to parse xml: " + e + System.lineSeparator() + s, e);
}
})
.collect(Collectors.toList());
XmlNode config = XmlNode.newInstance("configuration", null, null, children, null);
pluginConfiguration = XmlService.merge(config, pluginConfiguration);
// load default config
// pluginkey = groupId : artifactId : version : goal
Mojo mojo = lookup(Mojo.class, coord[0] + ":" + coord[1] + ":" + coord[2] + ":" + coord[3]);
for (MojoDescriptor mojoDescriptor : descriptor.getMojos()) {
if (Objects.equals(mojoDescriptor.getGoal(), coord[3])) {
if (pluginConfiguration != null) {
pluginConfiguration = finalizeConfig(pluginConfiguration, mojoDescriptor);
}
}
}
Session session = getInjector().getInstance(Session.class);View on GitHub (pinned to e4093d4e12)
When it happens
Trigger: Thrown at impl/maven-testing/src/main/java/org/apache/maven/testing/plugin/MojoExtension.java:291 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/239dc90659058af8.
Report an issue: GitHub.