{"record":{"id":"0c9b24352101df11","repo":"apache/maven","slug":"unable-to-parse-configuration-of-mojo-mojodescri","errorCode":null,"errorMessage":"Unable to parse configuration of mojo ${mojoDescriptor.getId()} for parameter ${e.getFailedConfiguration().getName()}: ${e.getMessage()}","messagePattern":"Unable to parse configuration of mojo (.+?) for parameter (.+?): (.+?)","errorType":"exception","errorClass":"PluginConfigurationException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java","lineNumber":841,"sourceCode":"                if (\"basic\".equals(configuratorId)) {\n                    throw new PluginParameterException(mojoDescriptor, new ArrayList<>(missingParameters));\n                } else {\n                    /*\n                     * NOTE: Other configurators like the map-oriented one don't call into the listener, so do it the\n                     * hard way.\n                     */\n                    validateParameters(mojoDescriptor, configuration, expressionEvaluator);\n                }\n            }\n\n        } catch (ComponentConfigurationException e) {\n            String message = \"Unable to parse configuration of mojo \" + mojoDescriptor.getId();\n            if (e.getFailedConfiguration() != null) {\n                message += \" for parameter \" + e.getFailedConfiguration().getName();\n            }\n            message += \": \" + e.getMessage();\n\n            throw new PluginConfigurationException(mojoDescriptor.getPluginDescriptor(), message, e);\n        } catch (ComponentLookupException e) {\n            throw new PluginConfigurationException(\n                    mojoDescriptor.getPluginDescriptor(),\n                    \"Unable to retrieve component configurator \" + configuratorId + \" for configuration of mojo \"\n                            + mojoDescriptor.getId(),\n                    e);\n        } catch (NoClassDefFoundError e) {\n            ByteArrayOutputStream os = new ByteArrayOutputStream(1024);\n            PrintStream ps = new PrintStream(os);\n            ps.println(\"A required class was missing during configuration of mojo \" + mojoDescriptor.getId() + \": \"\n                    + e.getMessage());\n            pluginRealm.display(ps);\n\n            throw new PluginConfigurationException(mojoDescriptor.getPluginDescriptor(), os.toString(), e);\n        } catch (LinkageError e) {\n            ByteArrayOutputStream os = new ByteArrayOutputStream(1024);\n            PrintStream ps = new PrintStream(os);\n            ps.println(\"An API incompatibility was encountered during configuration of mojo \" + mojoDescriptor.getId()","sourceCodeStart":823,"sourceCodeEnd":859,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java#L823-L859","documentation":"While the configurator was populating the mojo, a configuration entry could not be parsed or converted into the parameter's declared type (ComponentConfigurationException). Maven wraps it in PluginConfigurationException, naming the mojo, the offending parameter (from getFailedConfiguration().getName()), and the underlying conversion problem. The value reached the mojo, but in the wrong shape.","triggerScenarios":"XML text that cannot convert to the field type: non-numeric text for an int/double parameter, a value not in the parameter's enum, a malformed File path list, a ${...} expression evaluating to a value of the wrong shape, or nested child elements that do not match the parameter object's setters.","commonSituations":"Passing '3' to a boolean parameter; enum parameter values with wrong casing; expression returning an empty string where a number is required; plugin upgrade changing a parameter from a simple string to a structured object; wrong nesting depth in <configuration>.","solutions":["Note the parameter named in the message and check its declared type via mvn help:describe -Dplugin=<g:a:v> -Dgoal=<goal> -Ddetail.","Fix the value so it converts: correct casing for enums, true/false for booleans, numeric text for numbers.","Align the nested element structure with the parameter object's fields (or the version's new structure after an upgrade).","If the value comes from ${...}, run mvn help:evaluate -Dexpression=<expr> -DforceStdout to see what it resolves to.","Run mvn help:effective-pom to confirm the final configuration Maven actually received."],"exampleFix":"// before: value does not convert to the boolean parameter 'enabled'\n<configuration>\n  <enabled>3</enabled>\n</configuration>\n\n// after: value matches the declared parameter type\n<configuration>\n  <enabled>true</enabled>\n</configuration>","handlingStrategy":"validation","validationCode":"# know the declared type before passing a value\nmvn help:describe -Dplugin=<groupId>:<artifactId>:<version> -Dgoal=<goal> -Ddetail | sed -n '/<parameterName>/,/Type/p'\n\n# see the final configuration Maven will receive\nmvn help:effective-pom -Doutput=/tmp/eff.xml && grep -A6 '<parameterName>' /tmp/eff.xml","typeGuard":null,"tryCatchPattern":"// embedder: surface which element failed conversion\ntry {\n    executor.execute(session, mojoExecution);\n} catch (PluginConfigurationException e) {\n    if (e.getCause() instanceof ComponentConfigurationException cce\n            && cce.getFailedConfiguration() != null) {\n        log.error('bad value for <{}>: {}', cce.getFailedConfiguration().getName(), cce.getMessage());\n    }\n    throw e;\n}","preventionTips":["Match value shape to the parameter type declared in help:describe -Ddetail (enum casing, booleans as true/false).","After plugin upgrades, re-read the parameter docs: simple values sometimes become structured objects.","Check expressions with help:evaluate before embedding them in typed parameters.","Lint the effective POM in CI for configuration elements unknown to the plugin version."],"tags":["maven","plugin","configuration","type-conversion"],"backgroundTag":"config-type-conversion-failed","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}