elastic/elasticsearch · error · InvalidUserDataException
Unknown properties for mapping on dependencyLicenses: {}
Error message
Unknown properties for mapping on dependencyLicenses: {} What it means
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.
Source
Thrown at build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/AbstractDependenciesTask.java:40
@Input
@Optional
public abstract MapProperty<String, String> getMappings();
/**
* Add a mapping from a regex pattern for the jar name, to a prefix to find
* the LICENSE and NOTICE file for that jar.
*/
public void mapping(Map<String, String> props) {
String from = props.get("from");
if (from == null) {
throw new InvalidUserDataException("Missing \"from\" setting for license name mapping");
}
String to = props.get("to");
if (to == null) {
throw new InvalidUserDataException("Missing \"to\" setting for license name mapping");
}
if (props.size() > 2) {
throw new InvalidUserDataException("Unknown properties for mapping on dependencyLicenses: " + props.keySet());
}
getMappings().put(from, to);
}
}
View on GitHub (pinned to db6a809a66)
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.
Example fix
// before dependencyLicenses.mapping(from: 'lucene-core', to: 'lucene', prefix: 'lucene') // after dependencyLicenses.mapping(from: 'lucene-core', to: 'lucene')
Defensive patterns
Strategy: validation
Validate before calling
if (props.size() > 2) {
throw new InvalidUserDataException("Unknown properties for mapping on dependencyLicenses: " + props.keySet());
} Prevention
- 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.
When it happens
Trigger: Calling dependencyLicenses.mapping(from: 'x', to: 'y', extra: 'z') or passing a map literal with an unexpected key like 'name', 'regex', or 'prefix'.
Common situations: 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.
Related errors
- Missing "from" setting for license name mapping
- Missing "to" setting for license name mapping
- License category name must be exactly 5 characters, got ${ca
- Cannot set Elasticsearch Distribution type to ${type}. Type
- platform cannot be set on elasticsearch distribution [${name
AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12).
Data as JSON: /api/errors/82fb81451574051f.
Report an issue: GitHub.