quarkusio/quarkus · error · RuntimeException
Failed to read
Error message
Failed to read
What it means
Generic failure guard in DefaultEffectiveModelResolver.resolveEffectiveModel: an earlier 'Failed to resolve <coords>' exception is being re-thrown as a RuntimeException while trying to read the resolved pom and build the effective model for the given coordinates. The real cause is the nested BootstrapMavenException identifying which artifact pom could not be fetched.
Source
Thrown at independent-projects/bootstrap/maven-resolver/src/main/java/io/quarkus/bootstrap/resolver/maven/DefaultEffectiveModelResolver.java:84
return project.getEffectiveModel();
}
}
final File pomFile;
final ArtifactResult pomResult;
try {
pomResult = resolver.resolve(new DefaultArtifact(coords.getGroupId(), coords.getArtifactId(),
coords.getClassifier(), coords.getType(), coords.getVersion()), repos);
pomFile = pomResult.getArtifact().getFile();
} catch (BootstrapMavenException e) {
throw new RuntimeException("Failed to resolve " + coords.toCompactCoords(), e);
}
final Model rawModel;
try {
rawModel = ModelUtils.readModel(pomFile.toPath());
} catch (IOException e1) {
throw new RuntimeException("Failed to read " + pomFile, e1);
}
final ModelResolver modelResolver;
try {
modelResolver = BootstrapModelResolver.newInstance(resolver.getMavenContext(), null);
} catch (BootstrapMavenException e) {
throw new RuntimeException("Failed to initialize model resolver", e);
}
// override the relative path to the parent in case it's in the local Maven repo
Parent parent = rawModel.getParent();
if (parent != null) {
final Artifact parentPom = new DefaultArtifact(parent.getGroupId(), parent.getArtifactId(),
ArtifactCoords.TYPE_POM, parent.getVersion());
final ArtifactResult parentResult;
final Path parentPomPath;
try {
parentResult = resolver.resolve(parentPom, repos);View on GitHub (pinned to e1c734241f)
Solutions
- Delete the corrupt POM (and .lastUpdated/.part files) from the local repository and let Maven re-download it
- Check file permissions on ~/.m2/repository paths
- Verify disk space and filesystem health; disable interfering antivirus indexing on the repo directory
- Re-run with a clean local repository (-Dmaven.repo.local=fresh-dir) to isolate corruption
Example fix
// before rm -rf ~/.m2/repository/com/acme/app/1.0.0 (corrupt files kept) // after corrupt pom deleted, re-run resolution so a fresh POM is downloaded
Defensive patterns
Strategy: validation
Validate before calling
Path pom = pomFile.toPath();
if (!java.nio.file.Files.isReadable(pom) || java.nio.file.Files.size(pom) == 0) {
java.nio.file.Files.deleteIfExists(pom); // force re-download of corrupt POM
} Prevention
- Delete 0-byte or .part files from the local repository before resolving
- Ensure ~/.m2/repository is not on a flaky/readonly mount
- Exclude the Maven repo directory from antivirus scanning
When it happens
Trigger: resolveEffectiveModel(...) after successful resolver.resolve() of the POM, when pomFile is unreadable (permissions, truncated/corrupt download, file deleted between resolve and read).
Common situations: Interrupted downloads leaving 0-byte or partial POMs in the local repository, disk permission problems, antivirus locking files on Windows, NFS/readonly ~/.m2 mounts.
Related errors
- Failed to load <pomPropsPath> from the classpath
- Unable to render all config
- Unable to create directory: ${directory}
- Unable to collect the target directories
- Unable to read the template: ${template}
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/34edfd9e44dd3b59.
Report an issue: GitHub.