{"record":{"id":"ad309ef59286f698","repo":"apache/maven","slug":"the-metadata","errorCode":null,"errorMessage":"The metadata {} {}{}","messagePattern":"The metadata (.+?) (.+?)(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"impl/maven-core/src/main/java/org/apache/maven/internal/aether/LoggingRepositoryListener.java","lineNumber":84,"sourceCode":"        Object metadata;\n        if (event.getMetadata().getFile() != null) {\n            metadata = event.getMetadata().getFile();\n        } else {\n            metadata = event.getMetadata();\n        }\n\n        String errorType = \" is invalid\";\n        if (exception instanceof FileNotFoundException) {\n            errorType = \" is inaccessible\";\n        }\n\n        String msg = \"\";\n        if (exception != null) {\n            msg = \": \" + exception.getMessage();\n        }\n\n        if (logger.isDebugEnabled()) {\n            logger.warn(\"The metadata {} {}{}\", metadata, errorType, msg, exception);\n        } else {\n            logger.warn(\"The metadata {} {}{}\", metadata, errorType, msg);\n        }\n    }\n\n    @Override\n    public void artifactDescriptorInvalid(RepositoryEvent event) {\n        // The exception stack trace is not really interesting here\n        logger.warn(\n                \"The POM for {} is invalid, transitive dependencies (if any) will not be available: {}\",\n                event.getArtifact(),\n                event.getException().getMessage());\n    }\n\n    @Override\n    public void artifactDescriptorMissing(RepositoryEvent event) {\n        logger.warn(\"The POM for {} is missing, no dependency information available\", event.getArtifact());\n    }","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/impl/maven-core/src/main/java/org/apache/maven/internal/aether/LoggingRepositoryListener.java#L66-L102","documentation":"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.","triggerScenarios":"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'.","commonSituations":"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.","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)."],"exampleFix":"# before: stale/corrupt local metadata keeps failing\n# after: purge and re-resolve\nrm ~/.m2/repository/com/example/artifact/maven-metadata-*.xml\nmvn -U dependency:resolve","handlingStrategy":"validation","validationCode":"# verify local metadata parses before building\nfor f in $(find ~/.m2/repository -name 'maven-metadata*.xml'); do\n  python3 -c \"import xml.dom.minidom,sys; xml.dom.minidom.parse('$f')\" || echo \"CORRUPT: $f\"\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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)."],"tags":["maven","metadata","repository-listener","corruption","validation"],"backgroundTag":"maven-metadata-invalid","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}