apache/maven · error · IllegalStateException

Extension conflicts in file ${extensionFile}: ${ga} defined

Error message

Extension conflicts in file ${extensionFile}: ${ga} defined on lines ${lineNumbers}

What it means

Error "Extension conflicts in file ${extensionFile}: ${ga} defined on lines ${lineNumbers}" thrown in apache/maven.

Source

Thrown at impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/BaseParser.java:548

            throw new IllegalArgumentException("Failed to parse extensions file: " + extensionsFile, e);
        }
    }

    protected List<CoreExtension> validateCoreExtensionsDescriptorFromFile(
            Path extensionFile, List<CoreExtension> coreExtensions, boolean allowMetaVersions) {
        Map<String, List<InputLocation>> gasLocations = new HashMap<>();
        Map<String, List<InputLocation>> metaVersionLocations = new HashMap<>();
        for (CoreExtension coreExtension : coreExtensions) {
            String ga = coreExtension.getGroupId() + ":" + coreExtension.getArtifactId();
            InputLocation location = coreExtension.getLocation("");
            gasLocations.computeIfAbsent(ga, k -> new ArrayList<>()).add(location);
            // TODO: metaversions could be extensible enum with these two values out of the box
            if ("LATEST".equals(coreExtension.getVersion()) || "RELEASE".equals(coreExtension.getVersion())) {
                metaVersionLocations.computeIfAbsent(ga, k -> new ArrayList<>()).add(location);
            }
        }
        if (gasLocations.values().stream().anyMatch(l -> l.size() > 1)) {
            throw new IllegalStateException("Extension conflicts in file " + extensionFile + ": "
                    + gasLocations.entrySet().stream()
                            .map(e -> e.getKey() + " defined on lines "
                                    + e.getValue().stream()
                                            .map(l -> String.valueOf(l.getLineNumber()))
                                            .collect(Collectors.joining(", ")))
                            .collect(Collectors.joining("; ")));
        }
        if (!allowMetaVersions && !metaVersionLocations.isEmpty()) {
            throw new IllegalStateException("Extension with illegal version in file " + extensionFile + ": "
                    + metaVersionLocations.entrySet().stream()
                            .map(e -> e.getKey() + " defined on lines "
                                    + e.getValue().stream()
                                            .map(l -> String.valueOf(l.getLineNumber()))
                                            .collect(Collectors.joining(", ")))
                            .collect(Collectors.joining("; ")));
        }
        return coreExtensions;
    }

View on GitHub (pinned to e4093d4e12)

When it happens

Trigger: Thrown at impl/maven-cli/src/main/java/org/apache/maven/cling/invoker/BaseParser.java:548 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21). Data as JSON: /api/errors/401d52c3ced82998. Report an issue: GitHub.