apache/maven · error · RepositoryException

Could not parse metadata {metadataPath}: {message}

Error message

Could not parse metadata {metadataPath}: {message}

What it means

Error "Could not parse metadata {metadataPath}: {message}" thrown in apache/maven.

Source

Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/resolver/MavenMetadata.java:121

        merged = true;
    }

    @Override
    public boolean isMerged() {
        return merged;
    }

    protected abstract void merge(Metadata recessive);

    static Metadata read(Path metadataPath) throws RepositoryException {
        if (!Files.exists(metadataPath)) {
            return Metadata.newInstance();
        }

        try (InputStream input = Files.newInputStream(metadataPath)) {
            return new MetadataStaxReader().read(input, false);
        } catch (IOException | XMLStreamException e) {
            throw new RepositoryException("Could not parse metadata " + metadataPath + ": " + e.getMessage(), e);
        }
    }

    private void write(Path metadataPath, Metadata metadata) throws RepositoryException {
        try {
            Files.createDirectories(metadataPath.getParent());
            try (OutputStream output = Files.newOutputStream(metadataPath)) {
                new MetadataStaxWriter().write(output, metadata);
            }
        } catch (IOException | XMLStreamException e) {
            throw new RepositoryException("Could not write metadata " + metadataPath + ": " + e.getMessage(), e);
        }
    }

    @Override
    public Map<String, String> getProperties() {
        return Collections.emptyMap();
    }

View on GitHub (pinned to e4093d4e12)

When it happens

Trigger: Thrown at impl/maven-impl/src/main/java/org/apache/maven/impl/resolver/MavenMetadata.java:121 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/bf8f686a59b60ade. Report an issue: GitHub.