apache/maven · error · RuntimeException
Unexpected end of expression
Error message
Unexpected end of expression
What it means
Error "Unexpected end of expression" thrown in apache/maven.
Source
Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java:312
*/
private Object parseUnary() {
if (current < tokens.size() && tokens.get(current).equals("-")) {
current++;
Object value = parseUnary();
return negate(value);
}
return parseTerm();
}
/**
* Parses individual terms (numbers, strings, booleans, parentheses, functions).
*
* @return the parsed term
* @throws RuntimeException if the expression ends unexpectedly or contains unknown tokens
*/
private Object parseTerm() {
if (current >= tokens.size()) {
throw new RuntimeException("Unexpected end of expression");
}
String token = tokens.get(current);
if (token.equals("(")) {
return parseParentheses();
} else if (functions.containsKey(token)) {
return parseFunction();
} else if ((token.startsWith("\"") && token.endsWith("\"")) || (token.startsWith("'") && token.endsWith("'"))) {
current++;
return token.length() > 1 ? token.substring(1, token.length() - 1) : "";
} else if (token.equalsIgnoreCase("true") || token.equalsIgnoreCase("false")) {
current++;
return Boolean.parseBoolean(token);
} else if (token.startsWith("${") && token.endsWith("}")) {
current++;
String propertyName = token.substring(2, token.length() - 1);
return propertyResolver.apply(propertyName);
} else {View on GitHub (pinned to e4093d4e12)
When it happens
Trigger: Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/model/profile/ConditionParser.java:312 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/4375c30af43f9354.
Report an issue: GitHub.