apache/maven · error · ComponentConfigurationException
Unable to convert configuration to xml node
Error message
Unable to convert configuration to xml node
What it means
When a mojo/component parameter is typed org.apache.maven.api.xml.XmlNode, DefaultBeanConfigurator's XmlConverter converts the Plexus configuration subtree to an XML node, evaluating every text value through the expression evaluator first; if evaluation throws ExpressionEvaluationException (in Maven this wraps a BeanConfigurationException from the value preprocessor), the binding fails with ComponentConfigurationException 'Unable to convert configuration to xml node'. The culprit is interpolation inside that XML-valued parameter.
Source
Thrown at impl/maven-core/src/main/java/org/apache/maven/configuration/internal/DefaultBeanConfigurator.java:163
public boolean canConvert(Class<?> type) {
return XmlNode.class.equals(type);
}
@Override
public Object fromConfiguration(
final ConverterLookup lookup,
final PlexusConfiguration configuration,
final Class<?> type,
final Class<?> enclosingType,
final ClassLoader loader,
final ExpressionEvaluator evaluator,
final ConfigurationListener listener)
throws ComponentConfigurationException {
try {
return toXml(configuration, evaluator);
} catch (ExpressionEvaluationException e) {
throw new ComponentConfigurationException("Unable to convert configuration to xml node", e);
}
}
XmlNode toXml(PlexusConfiguration config, ExpressionEvaluator evaluator) throws ExpressionEvaluationException {
List<XmlNode> children = new ArrayList<>();
for (PlexusConfiguration c : config.getChildren()) {
children.add(toXml(c, evaluator));
}
String name = config.getName();
Object value = evaluator.evaluate(config.getValue());
return XmlNode.newInstance(name, value != null ? value.toString() : null, null, children, null);
}
}
static class PathConverter extends AbstractBasicConverter {
@Override
public boolean canConvert(Class<?> type) {
return Path.class.equals(type);View on GitHub (pinned to e4093d4e12)
Solutions
- Locate the ${...} token inside the failing plugin's XML-valued parameter and fix or remove it.
- Pass dynamic values through simple string parameters and reference them, keeping literal XML static.
- Check plugin version compatibility - older plugins may use expressions the current evaluator refuses.
- If the expression is intentional, verify the referenced property/object exists at configuration time (set it via -D, settings, or profile).
Example fix
<!-- before: expression inside an XmlNode-valued parameter the evaluator cannot resolve -->
<config>
<ruleset>${build.ruleset.dir}/rules.xml</ruleset>
</config>
<!-- after: literal value (or bind via a plain String parameter) -->
<config>
<ruleset>src/main/resources/rules.xml</ruleset>
</config> Defensive patterns
Strategy: try-catch
Try / catch
try {
configurator.configureBean(request); // XmlConverter failures surface here
} catch (BeanConfigurationException e) {
if (e.getMessage() != null && e.getMessage().contains("Unable to convert configuration to xml node")) {
reportBadExpressionInParameter(request, e); // point at the ${...} inside the XML param
} else {
throw e;
}
} Prevention
- Keep ${...} out of XmlNode-valued parameters; move dynamic values to plain string parameters.
- Test plugin configurations with all profiles active so every expression resolves.
- After Maven/plugin upgrades, grep plugin XML blobs for interpolation tokens.
When it happens
Trigger: A plugin configuration block bound to an XmlNode parameter whose text contains ${...} that the preprocessor fails on - e.g. expressions referencing objects unavailable at configuration time, or nested/malformed expression syntax the evaluator rejects.
Common situations: Plugins with XML-blob parameters (inline rule/config fragments) embedding property placeholders; upgrades changing which expressions the evaluator accepts; builds where a property referenced in XML config is consumed before the context providing it exists.
Related errors
- Cannot serialize project model for interpolation.
- Cannot read project model from interpolating filter of seria
- Basic element '{}' must not contain child elements
- Cannot evaluate expression '%s' for configuration entry '%s'
- Repository list contains duplicate entries. Each repository
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/a9bab59125ff865a.
Report an issue: GitHub.