{"record":{"id":"82fb81451574051f","repo":"elastic/elasticsearch","slug":"unknown-properties-for-mapping-on-dependencylicens","errorCode":null,"errorMessage":"Unknown properties for mapping on dependencyLicenses: {}","messagePattern":"Unknown properties for mapping on dependencyLicenses: (.+?)","errorType":"exception","errorClass":"InvalidUserDataException","httpStatus":null,"severity":"error","filePath":"build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/AbstractDependenciesTask.java","lineNumber":40,"sourceCode":"    @Input\n    @Optional\n    public abstract MapProperty<String, String> getMappings();\n\n    /**\n     * Add a mapping from a regex pattern for the jar name, to a prefix to find\n     * the LICENSE and NOTICE file for that jar.\n     */\n    public void mapping(Map<String, String> props) {\n        String from = props.get(\"from\");\n        if (from == null) {\n            throw new InvalidUserDataException(\"Missing \\\"from\\\" setting for license name mapping\");\n        }\n        String to = props.get(\"to\");\n        if (to == null) {\n            throw new InvalidUserDataException(\"Missing \\\"to\\\" setting for license name mapping\");\n        }\n        if (props.size() > 2) {\n            throw new InvalidUserDataException(\"Unknown properties for mapping on dependencyLicenses: \" + props.keySet());\n        }\n        getMappings().put(from, to);\n    }\n}\n","sourceCodeStart":22,"sourceCodeEnd":45,"githubUrl":"https://github.com/elastic/elasticsearch/blob/db6a809a667c081ca1dc7500389d26975573215f/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/AbstractDependenciesTask.java#L22-L45","documentation":"Thrown by AbstractDependenciesTask.mapping when the map contains more than the two allowed keys (\"from\" and \"to\"). Any extra key is rejected to catch typos and misconfigured mapping calls.","triggerScenarios":"Calling dependencyLicenses.mapping(from: 'x', to: 'y', extra: 'z') or passing a map literal with an unexpected key like 'name', 'regex', or 'prefix'.","commonSituations":"Typo such as 'form' instead of 'from' (leaving the real key missing and adding a spurious one); copy-paste from a different DSL that uses different key names.","solutions":["Remove any key other than 'from' and 'to' from the mapping map.","Check for common typos: 'form' vs 'from', 'dest' vs 'to', 'pattern' vs 'from'.","Confirm exactly two entries remain after cleanup."],"exampleFix":"// before\ndependencyLicenses.mapping(from: 'lucene-core', to: 'lucene', prefix: 'lucene')\n// after\ndependencyLicenses.mapping(from: 'lucene-core', to: 'lucene')","handlingStrategy":"validation","validationCode":"if (props.size() > 2) {\n    throw new InvalidUserDataException(\"Unknown properties for mapping on dependencyLicenses: \" + props.keySet());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict mapping maps to exactly the keys 'from' and 'to'.","Watch for typo keys ('form', 'dest', 'pattern') that inflate the size.","Use Groovy named arguments so stray keys are visually obvious."],"tags":["gradle","licensing","build-script","build-tools"],"analyzedSha":"db6a809a667c081ca1dc7500389d26975573215f","analyzedAt":"2026-08-12T01:39:14.192Z","schemaVersion":2},"datasetVersion":"2026-08-12T12:17:08.281Z"}