quarkusio/quarkus · error · RuntimeException

Failed to read ${p}

Error message

Failed to read ${p}

What it means

When scanning dependency jars to detect Quarkus extensions, the mojo opens each jar as a zip filesystem (ZipUtils.newFileSystem) and looks for the extension descriptor. An IOException while reading a jar is wrapped in RuntimeException('Failed to read <path>').

Source

Thrown at independent-projects/extension-maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java:760

                    Path p = a.getFile().toPath();
                    boolean isExtension = false;
                    if (Files.isDirectory(p)) {
                        isExtension = getExtensionDescriptorOrNull(p) != null;
                    } else {
                        // in some cases a local dependency might not producing the classes directory
                        // but assembling the JAR directly using maven plugins
                        if (!Files.exists(p)) {
                            final Path workspaceJar = p.getParent().resolve(LocalWorkspace.getFileName(a));
                            if (!Files.exists(workspaceJar)) {
                                getLog().warn("Failed to resolve " + a + ", " + p + " does not exist");
                                return true;
                            }
                            p = workspaceJar;
                        }
                        try (FileSystem fs = ZipUtils.newFileSystem(p)) {
                            isExtension = getExtensionDescriptorOrNull(fs.getPath("")) != null;
                        } catch (IOException e) {
                            throw new RuntimeException("Failed to read " + p, e);
                        }
                    }
                    if (isExtension) {
                        ArrayNode deps = extensionDeps.get();
                        if (deps == null) {
                            deps = getMetadataNode(extObject).putArray("extension-dependencies");
                            extensionDeps.set(deps);
                        }
                        deps.add(ArtifactKey.of(a.getGroupId(), a.getArtifactId(), a.getClassifier(), a.getExtension())
                                .toGacString());
                    }
                }
                return true;
            }

            @Override
            public boolean visitLeave(DependencyNode node) {
                return true;

View on GitHub (pinned to e1c734241f)

Solutions

  1. Delete the corrupted jar from ~/.m2/repository and re-download (mvn -U)
  2. Verify the jar opens: unzip -t <path-to-jar>
  3. Check file permissions on the local repository
  4. If a non-zip artifact is declared with jar type, correct the dependency type/classifier

Example fix

# before: corrupt jar
unzip -t ~/.m2/repository/broken.jar  # fails
# after
del ~/.m2/repository/broken/path
mvn -U clean install
Defensive patterns

Strategy: validation

Validate before calling

unzip -t path/to/dependency.jar

Prevention

When it happens

Trigger: A dependency jar in the runtime dependency list is corrupt, empty, truncated, or unreadable while the mojo iterates dependencies to find extension-dependencies.

Common situations: Interrupted downloads leaving partial jars in ~/.m2; jars with wrong zip structure; permission issues; non-jar files misdeclared as jar dependencies.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/8160f092a4adf462. Report an issue: GitHub.