apache/maven · warning
The metadata {} {}{}
Error message
The metadata {} {}{} What it means
Warning emitted by LoggingRepositoryListener.metadataInvalid when artifact metadata (maven-metadata.xml) downloaded from a repository fails post-fetch validation (MetadataInvalidException). The suffix 'is inaccessible' (instead of 'is invalid') is used when the underlying exception is FileNotFoundException, e.g. the local file vanished. With -X debug enabled the full exception (with stack trace) is attached; without it only the exception message. Resolution continues; the metadata is treated as absent.
Source
Thrown at impl/maven-core/src/main/java/org/apache/maven/internal/aether/LoggingRepositoryListener.java:84
Object metadata;
if (event.getMetadata().getFile() != null) {
metadata = event.getMetadata().getFile();
} else {
metadata = event.getMetadata();
}
String errorType = " is invalid";
if (exception instanceof FileNotFoundException) {
errorType = " is inaccessible";
}
String msg = "";
if (exception != null) {
msg = ": " + exception.getMessage();
}
if (logger.isDebugEnabled()) {
logger.warn("The metadata {} {}{}", metadata, errorType, msg, exception);
} else {
logger.warn("The metadata {} {}{}", metadata, errorType, msg);
}
}
@Override
public void artifactDescriptorInvalid(RepositoryEvent event) {
// The exception stack trace is not really interesting here
logger.warn(
"The POM for {} is invalid, transitive dependencies (if any) will not be available: {}",
event.getArtifact(),
event.getException().getMessage());
}
@Override
public void artifactDescriptorMissing(RepositoryEvent event) {
logger.warn("The POM for {} is missing, no dependency information available", event.getArtifact());
}View on GitHub (pinned to e4093d4e12)
Solutions
- Run with -X to get the underlying exception and the failing file/URI.
- Delete the local cached copy (find ~/.m2/repository -name 'maven-metadata*.xml' in the artifact's path) and re-resolve.
- Fetch the metadata URL with curl to inspect what the server actually returns; fix the server/proxy if it is not valid XML.
- If server-side, ask the repository admin to repair or redeploy the affected metadata (rebuild metadata index in Nexus/Artifactory).
Example fix
# before: stale/corrupt local metadata keeps failing # after: purge and re-resolve rm ~/.m2/repository/com/example/artifact/maven-metadata-*.xml mvn -U dependency:resolve
Defensive patterns
Strategy: validation
Validate before calling
# verify local metadata parses before building
for f in $(find ~/.m2/repository -name 'maven-metadata*.xml'); do
python3 -c "import xml.dom.minidom,sys; xml.dom.minidom.parse('$f')" || echo "CORRUPT: $f"
done Prevention
- Purge corrupted maven-metadata-*.xml with -U after network incidents instead of leaving stale caches.
- Ensure proxies/servers serve XML (not HTML login pages) at repository URLs.
- Monitor repository manager metadata health (Nexus/Artifactory repair tasks).
When it happens
Trigger: Repository listener fires after metadata check/download: the served maven-metadata.xml is malformed (truncated, HTML error page stored as XML, bad checksum content) or the local metadata file was deleted between discovery and parse. Non-debug builds get exactly this one-line warn with errorType ' is invalid' or ' is inaccessible'.
Common situations: Proxies returning a login HTML page where metadata XML is expected; partially uploaded metadata on the server; local repository corruption from interrupted downloads or disk issues; concurrent builds deleting each other's temp files.
Related errors
- Cannot read metadata from '{}': {}
- {} could not be retrieved from repository: {} due to an erro
- Error installing metadata: {}
- Error while deploying metadata: {}
- Cannot add two different pieces of metadata for: " + getKey(
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/ad309ef59286f698.
Report an issue: GitHub.