{"record":{"id":"48f48ce2545d4a08","repo":"quarkusio/quarkus","slug":"failed-to-read-f","errorCode":null,"errorMessage":"Failed to read ${f}","messagePattern":"Failed to read (.+?)","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"independent-projects/extension-maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java","lineNumber":1150,"sourceCode":"        }\n        try {\n            if (f.isDirectory()) {\n                return readExtensionDescriptorIfExists(f.toPath());\n            }\n            // In case of a parallel build, the resolved JAR might not have been fully written, which may result in a failure to read it\n            // so we try the classes dir first\n            if (session.isParallel()) {\n                final LocalProject localProject = workspaceProvider.getProject(a.getGroupId(), a.getArtifactId());\n                final Path classesDir = localProject == null ? null : localProject.getClassesDir();\n                if (classesDir != null && Files.exists(classesDir)) {\n                    return readExtensionDescriptorIfExists(classesDir);\n                }\n            }\n            try (FileSystem fs = ZipUtils.newFileSystem(f.toPath())) {\n                return readExtensionDescriptorIfExists(fs.getPath(\"\"));\n            }\n        } catch (Throwable e) {\n            throw new IllegalStateException(\"Failed to read \" + f, e);\n        }\n    }\n\n    private Properties readExtensionDescriptorIfExists(final Path classesDir) throws IOException {\n        final Path p = getExtensionDescriptorOrNull(classesDir);\n        return p == null ? null : readExtensionDescriptor(p);\n    }\n\n    private Path getExtensionDescriptorOrNull(Path runtimeExtRootDir) {\n        final Path p = runtimeExtRootDir.resolve(BootstrapConstants.DESCRIPTOR_PATH);\n        return Files.exists(p) ? p : null;\n    }\n\n    private Properties readExtensionDescriptor(final Path extDescr) throws IOException {\n        final Properties props = new Properties();\n        try (BufferedReader reader = Files.newBufferedReader(extDescr)) {\n            props.load(reader);\n        }","sourceCodeStart":1132,"sourceCodeEnd":1168,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/extension-maven-plugin/src/main/java/io/quarkus/maven/ExtensionDescriptorMojo.java#L1132-L1168","documentation":"When reading the extension descriptor from a project artifact file (jar/zip), any Throwable during opening the zip filesystem or reading the descriptor is wrapped in IllegalStateException('Failed to read <file>').","triggerScenarios":"getDeploymentArtifact / descriptor reading path: ZipUtils.newFileSystem(f.toPath()) fails because the file is not a valid zip/jar, is missing, or is unreadable.","commonSituations":"Target jar not yet built when mojo runs; corrupt artifact in local repo; wrong path passed; permission problems on CI.","solutions":["Ensure the project jar is built before running extension-descriptor (mvn package first)","Delete and re-download the corrupted artifact from the local repository","Check file exists and is readable at the printed path","If the file is not a jar (e.g. pom packaging), verify the mojo is only applied to jar-packaged extension modules"],"exampleFix":"# before: jar not built\nmvn extension-descriptor -pl my-ext\n# after\nmvn package extension-descriptor -pl my-ext","handlingStrategy":"validation","validationCode":"test -f target/my-ext-1.0.0.jar && unzip -t target/my-ext-1.0.0.jar","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run mvn package before descriptor goals","Confirm jar packaging type on extension modules","Check CI artifact permissions"],"tags":["maven","corrupt-jar","descriptor"],"backgroundTag":"corrupt-jar-file","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}