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

  1. Remove any key other than 'from' and 'to' from the mapping map.
  2. Check for common typos: 'form' vs 'from', 'dest' vs 'to', 'pattern' vs 'from'.
  3. 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

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


AI-assisted analysis of elastic/elasticsearch@db6a809a66 (2026-08-12). Data as JSON: /api/errors/82fb81451574051f. Report an issue: GitHub.