apache/maven · warning · RepositoryMetadataReadException
Cannot read metadata from '{}'
Error message
Cannot read metadata from '{}' What it means
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.
Source
Thrown at compat/maven-compat/src/main/java/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.java:278
if (repoMetadata.getMetadata() != null) {
setRepository = repoMetadata.getMetadata().merge(metadata);
} else {
repoMetadata.setMetadata(metadata);
setRepository = true;
}
}
return setRepository;
}
/*
* TODO share with DefaultPluginMappingManager.
*/
protected Metadata readMetadata(File mappingFile) throws RepositoryMetadataReadException {
try (InputStream in = Files.newInputStream(mappingFile.toPath())) {
return new Metadata(new MetadataStaxReader().read(in, false));
} catch (FileNotFoundException e) {
throw new RepositoryMetadataReadException("Cannot read metadata from '" + mappingFile + "'", e);
} catch (IOException | XMLStreamException e) {
throw new RepositoryMetadataReadException(
"Cannot read metadata from '" + mappingFile + "': " + e.getMessage(), e);
}
}
/**
* Ensures the last updated timestamp of the specified metadata does not refer to the future and fixes the local
* metadata if necessary to allow proper merging/updating of metadata during deployment.
*/
private void fixTimestamp(File metadataFile, Metadata metadata, Metadata reference) {
boolean changed = false;
if (metadata != null && reference != null) {
Versioning versioning = metadata.getVersioning();
Versioning versioningRef = reference.getVersioning();
if (versioning != null && versioningRef != null) {
String lastUpdated = versioning.getLastUpdated();View on GitHub (pinned to e4093d4e12)
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
Example fix
<!-- before: String field 'pattern' contains nested XML --> <configuration> <pattern><value>.*</value></pattern> </configuration> <!-- after: plain text for the String property --> <configuration> <pattern>.*</pattern> </configuration>
Defensive patterns
Strategy: validation
Validate before calling
# surface nested XML inside configuration values that map to String fields xmllint --xpath '//configuration//*[*]' src/main/resources/META-INF/plexus/components.xml \ && echo 'nested element found in a scalar configuration value'
Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Unable to lookup org.eclipse.aether.RepositorySystem
- Error in component graph of plugin ${plugin.getId()}: ${e.ge
- Unable to load the mojo '${mojoDescriptor.getGoal()}' (or on
- %nThere can only be one user supplied ConfigurationProcessor
- No binding to construct an instance for key {}. Existing bi
AI-assisted analysis of apache/maven@e4093d4e12 (2026-08-21).
Data as JSON: /api/errors/50225e9e6af15939.
Report an issue: GitHub.