gradle/gradle · error · IllegalArgumentException

${context} format must be <group>:<artifact> but '${lockExcl

Error message

${context} format must be <group>:<artifact> but '${lockExclude}' is invalid.

What it means

Error "${context} format must be <group>:<artifact> but '${lockExclude}' is invalid." thrown in gradle/gradle.

Source

Thrown at platforms/software/dependency-management/src/main/java/org/gradle/internal/locking/LockEntryFilterFactory.java:60

                String[] split = lockExclude.split(MODULE_SEPARATOR);
                validateNotation(lockExclude, split, allowFullWildcard, context);

                lockEntryFilters.add(createFilter(split[0], split[1]));
            }
            if (lockEntryFilters.isEmpty()) {
                throwInvalid(lockExcludes, context);
            }
        }

        if (lockEntryFilters.size() == 1) {
            return lockEntryFilters.iterator().next();
        } else {
            return new AggregateLockEntryFilter(lockEntryFilters);
        }
    }

    private static void throwInvalid(String lockExclude, String context) {
        throw new IllegalArgumentException(context + " format must be <group>:<artifact> but '" + lockExclude + "' is invalid.");
    }

    private static LockEntryFilter createFilter(final String group, final String module) {
        if (group.equals(WILDCARD_SUFFIX) && module.equals(WILDCARD_SUFFIX)) {
            return FILTERS_ALL;
        }

        return new GroupModuleLockEntryFilter(group, module);
    }

    private static void validateNotation(String lockExclude, String[] split, boolean allowFullWildcard, String context) {
        if (split.length != 2) {
            throwInvalid(lockExclude, context);
        }
        String group = split[0];
        String module = split[1];

        if ((group.contains(WILDCARD_SUFFIX) && !group.endsWith(WILDCARD_SUFFIX)) || (module.contains(WILDCARD_SUFFIX) && !module.endsWith(WILDCARD_SUFFIX))) {

View on GitHub (pinned to 534f27719b)

Solutions

  1. Format the entry as '<group>:<artifact>', for example 'com.google.guava:guava'.
  2. Fix or remove the invalid entry '${lockExclude}' in the lock exclude/include filter configuration.

When it happens

Trigger: Thrown at platforms/software/dependency-management/src/main/java/org/gradle/internal/locking/LockEntryFilterFactory.java:60 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gradle/gradle@534f27719b (2026-08-22). Data as JSON: /api/errors/cf2bec1fc9dc34d2. Report an issue: GitHub.