{"record":{"id":"2e6df0e79319c96f","repo":"apache/maven","slug":"cannot-find-in","errorCode":null,"errorMessage":"Cannot find '{}' in {}","messagePattern":"Cannot find '(.+?)' in (.+?)","errorType":"exception","errorClass":"ComponentConfigurationException","httpStatus":null,"severity":"error","filePath":"impl/maven-core/src/main/java/org/apache/maven/configuration/internal/EnhancedCompositeBeanHelper.java","lineNumber":160,"sourceCode":"        Field field = findCachedField(beanType, propertyName);\n        if (field != null) {\n            try {\n                Object value = convertPropertyForField(beanType, field, valueType, configuration);\n                if (value != null) {\n                    if (listener != null) {\n                        listener.notifyFieldChangeUsingReflection(propertyName, value, bean);\n                    }\n                    setFieldValue(bean, field, value);\n                    return;\n                }\n            } catch (IllegalAccessException | LinkageError e) {\n                // Continue to error handling\n            }\n        }\n\n        // If we get here, we couldn't set the property\n        if (methodInfo == null && field == null) {\n            throw new ComponentConfigurationException(\n                    configuration, \"Cannot find '\" + propertyName + \"' in \" + beanType);\n        }\n    }\n\n    /**\n     * Find method using cache for improved performance.\n     */\n    private MethodInfo findCachedMethod(Class<?> beanType, String propertyName, Class<?> valueType) {\n        Map<String, MethodInfo> classMethodCache = METHOD_CACHE.computeIfAbsent(beanType, this::buildMethodCache);\n\n        String title = Character.toTitleCase(propertyName.charAt(0)) + propertyName.substring(1);\n\n        // Try setter first\n        MethodInfo setter = classMethodCache.get(\"set\" + title);\n        if (setter != null && isMethodCompatible(setter.method, valueType)) {\n            return setter;\n        }\n","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/configuration/internal/EnhancedCompositeBeanHelper.java#L142-L178","documentation":"Plexus bean configuration could not map a configuration element to any writable property of the target class. EnhancedCompositeBeanHelper.setProperty() looks for a setter/adder method ('setFoo'/'addFoo' for element 'foo') and then for a declared field named 'foo'; the error is thrown only when BOTH lookups fail (methodInfo == null && field == null), i.e. the bean exposes no such property at all.","triggerScenarios":"A mojo/component <configuration> block containing an XML element whose name (converted from XML naming) matches no setX/addX method and no declared non-static field on the mojo or configured component. Note the companion behavior: if a setter exists but its invocation fails, the helper silently falls through and this error is NOT thrown.","commonSituations":"Typo in a configuration parameter name; using a parameter that an older plugin version had but a newer one renamed or removed; copy-pasting configuration between goals that do not share parameters; configuring a component whose implementation class changed between releases.","solutions":["Check the goal's actual parameters and fix the element name: mvn help:describe -Dplugin=groupId:artifactId:version -Dgoal=<goal> -Ddetail","Pin the plugin version you wrote the configuration for (parameters differ across versions) via pluginManagement","If the parameter was removed in the plugin version you use, delete the element from the configuration","For your own components, add a setFoo(...) setter or a foo field to the implementation class"],"exampleFix":"<!-- before: element matches no property -->\n<configuration>\n  <destDir>${project.build.directory}/site</destDir>\n</configuration>\n\n<!-- after: use a parameter the goal declares -->\n<configuration>\n  <outputDirectory>${project.build.directory}/site</outputDirectory>\n</configuration>","handlingStrategy":"validation","validationCode":"// Before applying foreign configuration XML, verify each element maps to a property\nSet<String> writable = new HashSet<>();\nfor (Method m : mojo.getClass().getMethods()) {\n    if (m.getParameterCount() == 1) {\n        writable.add(fromCamel(m.getName().startsWith(\"set\") ? m.getName().substring(3) : null));\n    }\n}\nfor (PlexusConfiguration child : configuration.getChildren()) {\n    if (!writable.contains(child.getName())) {\n        throw new IllegalArgumentException(\"Unknown configuration element: \" + child.getName());\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Generate configuration skeletons from the goal descriptor (mvn help:describe -Ddetail) instead of hand-copying","Pin plugin versions so parameter sets are stable","Treat any 'element not found' as a naming mismatch first — check spelling against the parameter list before debugging deeper"],"tags":["maven","plexus","plugin-configuration","typo","mojo-parameters"],"backgroundTag":"unknown-configuration-parameter","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}