{"record":{"id":"7fb865f72880c652","repo":"apache/maven","slug":"error-evaluating-the-expression-expression-fo","errorCode":null,"errorMessage":"Error evaluating the expression '${expression}' for configuration value '${configuration.getName()}'","messagePattern":"Error evaluating the expression '(.+?)' for configuration value '(.+?)'","errorType":"exception","errorClass":"ComponentConfigurationException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java","lineNumber":904,"sourceCode":"                continue;\n            }\n\n            Object value = null;\n\n            PlexusConfiguration config = configuration.getChild(parameter.getName(), false);\n            if (config != null) {\n                String expression = config.getValue(null);\n\n                try {\n                    value = expressionEvaluator.evaluate(expression);\n\n                    if (value == null) {\n                        value = config.getAttribute(\"default-value\", null);\n                    }\n                } catch (ExpressionEvaluationException e) {\n                    String msg = \"Error evaluating the expression '\" + expression + \"' for configuration value '\"\n                            + configuration.getName() + \"'\";\n                    throw new ComponentConfigurationException(configuration, msg, e);\n                }\n            }\n\n            if (value == null && (config == null || config.getChildCount() <= 0)) {\n                invalidParameters.add(parameter);\n            }\n        }\n\n        if (!invalidParameters.isEmpty()) {\n            throw new PluginParameterException(mojoDescriptor, invalidParameters);\n        }\n    }\n\n    @Override\n    public void releaseMojo(Object mojo, MojoExecution mojoExecution) {\n        if (mojo != null) {\n            try {\n                container.release(mojo);","sourceCodeStart":886,"sourceCodeEnd":922,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java#L886-L922","documentation":"While validating parameters for a non-basic configurator, Maven tried to evaluate a ${...} expression in the parameter configuration and the expression evaluator threw ExpressionEvaluationException — the expression could not be evaluated at all (unparseable or references an object path that does not exist), as opposed to evaluating to null. It is wrapped as ComponentConfigurationException naming both the expression and the configuration element, then aggregated into the goal's PluginParameterException.","triggerScenarios":"A typo inside ${...} (e.g. ${project.build.diretory}); an expression referencing a property or object path that is not defined in this session/POM; expression syntax the evaluator cannot parse; value read via config.getValue(null) being a malformed expression.","commonSituations":"Renamed/misspelled properties; properties defined in an inactive profile or supplied only by CI on another job; expressions valid in a newer Maven version used on an older one; interpolated values inherited from a parent POM that drift.","solutions":["Correct the expression named in the message — usually a typo in a property or object path.","Define the property in <properties> (or the right profile) and re-run.","Pre-test any expression with mvn help:evaluate -Dexpression=<expr> -DforceStdout before wiring it into configuration.","Use the default-value attribute in plugin.xml (for plugin authors) so absent values fall back instead of failing.","Check mvn help:effective-pom to see the raw expression as Maven received it."],"exampleFix":"// before: typo in the expression, evaluation fails\n<outputDirectory>${project.build.diretory}/extra</outputDirectory>\n\n// after: correct expression\n<outputDirectory>${project.build.directory}/extra</outputDirectory>","handlingStrategy":"validation","validationCode":"# pre-test every expression you plan to embed in plugin configuration\nfor expr in project.build.directory project.version some.custom.property; do\n  echo \"$expr -> $(mvn -q help:evaluate -Dexpression=$expr -DforceStdout 2>/dev/null || echo '<EVALUATION FAILED>')\"\ndone","typeGuard":null,"tryCatchPattern":"// embedder: when validating parameters yourself, catch and name the failing expression\ntry {\n    configurator.configureComponent(mojo, configuration, evaluator, realm, validator);\n} catch (ComponentConfigurationException e) {\n    if (e.getCause() instanceof ExpressionEvaluationException eee) {\n        log.error('expression failed: {}', eee.getMessage());\n    }\n    throw e;\n}","preventionTips":["Validate expressions with help:evaluate before wiring them into plugin parameters.","Define properties used by configuration in <properties> at the top level, not only in CI secrets.","Prefer fully-qualified built-in expressions (project.build.directory) over remembered shortcuts.","grep the effective POM for '${' to review every interpolation you rely on."],"tags":["maven","plugin","expression","configuration","property-resolution"],"backgroundTag":"unresolvable-maven-expression","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}