{"record":{"id":"50225e9e6af15939","repo":"apache/maven","slug":"cannot-read-metadata-from","errorCode":null,"errorMessage":"Cannot read metadata from '{}'","messagePattern":"Cannot read metadata from '(.+?)'","errorType":"exception","errorClass":"RepositoryMetadataReadException","httpStatus":null,"severity":"warning","filePath":"compat/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java","lineNumber":278,"sourceCode":"            if (repoMetadata.getMetadata() != null) {\n                setRepository = repoMetadata.getMetadata().merge(metadata);\n            } else {\n                repoMetadata.setMetadata(metadata);\n                setRepository = true;\n            }\n        }\n        return setRepository;\n    }\n\n    /*\n     * TODO share with DefaultPluginMappingManager.\n     */\n    protected Metadata readMetadata(File mappingFile) throws RepositoryMetadataReadException {\n\n        try (InputStream in = Files.newInputStream(mappingFile.toPath())) {\n            return new Metadata(new MetadataStaxReader().read(in, false));\n        } catch (FileNotFoundException e) {\n            throw new RepositoryMetadataReadException(\"Cannot read metadata from '\" + mappingFile + \"'\", e);\n        } catch (IOException | XMLStreamException e) {\n            throw new RepositoryMetadataReadException(\n                    \"Cannot read metadata from '\" + mappingFile + \"': \" + e.getMessage(), e);\n        }\n    }\n\n    /**\n     * Ensures the last updated timestamp of the specified metadata does not refer to the future and fixes the local\n     * metadata if necessary to allow proper merging/updating of metadata during deployment.\n     */\n    private void fixTimestamp(File metadataFile, Metadata metadata, Metadata reference) {\n        boolean changed = false;\n\n        if (metadata != null && reference != null) {\n            Versioning versioning = metadata.getVersioning();\n            Versioning versioningRef = reference.getVersioning();\n            if (versioning != null && versioningRef != null) {\n                String lastUpdated = versioning.getLastUpdated();","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java#L260-L296","documentation":"Eclipse Sisu converts plexus-style XML (components.xml/plexus.xml) into typed bean values via PlexusXmlBeanConverter. When a component field maps to String but the parser sits on a nested element (START_TAG) instead of text, Sisu mimics old Plexus behavior: it warns with the exact parser position (file, line, column), skips the subtree, and injects an empty string for that field.","triggerScenarios":"A hand-written META-INF/plexus/components.xml or plexus.xml places child elements inside a configuration value that maps to a String bean property.","commonSituations":"Migrating legacy Plexus components to Sisu; copying old plexus examples into XML while the target field is a scalar; templates emitting nested defaults for simple values.","solutions":["Open the position named in the warning (it includes line and column) and flatten the value to plain text","Move structured data into a dedicated bean type the converter can build, instead of a String field","Prefer JSR-330/Sisu annotations over plexus XML to avoid the XML conversion heuristics entirely"],"exampleFix":"<!-- before: String field 'pattern' contains nested XML -->\n<configuration>\n  <pattern><value>.*</value></pattern>\n</configuration>\n<!-- after: plain text for the String property -->\n<configuration>\n  <pattern>.*</pattern>\n</configuration>","handlingStrategy":"validation","validationCode":"# surface nested XML inside configuration values that map to String fields\nxmllint --xpath '//configuration//*[*]' src/main/resources/META-INF/plexus/components.xml \\\n  && echo 'nested element found in a scalar configuration value'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write new components with JSR-330 annotations; keep plexus XML for legacy only","Validate components.xml during the build before packaging","Keep scalar configuration values as text, never as child elements"],"tags":["maven","sisu","plexus","xml-configuration","dependency-injection"],"backgroundTag":"component-xml-misconfiguration","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}