{"record":{"id":"63c21a683a8944bf","repo":"quarkusio/quarkus","slug":"failed-to-process-artifactpath","errorCode":null,"errorMessage":"Failed to process + artifactPath","messagePattern":"Failed to process \\+ artifactPath","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusApplicationModelTask.java","lineNumber":684,"sourceCode":"        public File getFile() {\n            return file;\n        }\n    }\n\n    private static boolean processQuarkusDependency(ResolvedDependencyBuilder artifactBuilder,\n            ApplicationModelBuilder modelBuilder) {\n        for (Path artifactPath : artifactBuilder.getResolvedPaths()) {\n            if (!Files.exists(artifactPath) || !artifactBuilder.getType().equals(ArtifactCoords.TYPE_JAR)) {\n                break;\n            }\n            if (Files.isDirectory(artifactPath)) {\n                return processQuarkusDir(artifactBuilder, artifactPath.resolve(BootstrapConstants.META_INF), modelBuilder);\n            } else {\n                try (FileSystem artifactFs = ZipUtils.newFileSystem(artifactPath)) {\n                    return processQuarkusDir(artifactBuilder, artifactFs.getPath(BootstrapConstants.META_INF),\n                            modelBuilder);\n                } catch (IOException e) {\n                    throw new RuntimeException(\"Failed to process \" + artifactPath, e);\n                }\n            }\n        }\n        return false;\n    }\n\n    private static boolean processQuarkusDir(ResolvedDependencyBuilder artifactBuilder, Path quarkusDir,\n            ApplicationModelBuilder modelBuilder) {\n        if (!Files.exists(quarkusDir)) {\n            return false;\n        }\n        final Path quarkusDescr = quarkusDir.resolve(BootstrapConstants.DESCRIPTOR_FILE_NAME);\n        if (!Files.exists(quarkusDescr)) {\n            return false;\n        }\n        final Properties extProps = readDescriptor(quarkusDescr);\n        if (extProps == null) {\n            return false;","sourceCodeStart":666,"sourceCodeEnd":702,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusApplicationModelTask.java#L666-L702","documentation":"Thrown from QuarkusApplicationModelTask when indexing an application dependency artifact: if the artifact is not a plain directory it is opened as a ZIP filesystem via ZipUtils.newFileSystem(), and an IOException there is wrapped as 'Failed to process <path>'. Typically means the artifact file is corrupt or not a valid zip/jar.","triggerScenarios":"Building the application model when a dependency jar on the classpath is truncated/corrupt (interrupted download), zero bytes, or has a non-zip format despite its path, while attempting to read META-INF/quarkus extension descriptors.","commonSituations":"Killed Gradle daemon leaving partial artifacts in cache; SNAPSHOT jars overwritten mid-build; network proxies corrupting downloads; a directory named *.jar in the local repo.","solutions":["Delete the reported artifactPath from ~/.gradle/caches/modules-2 (or the local repo) and re-run with --refresh-dependencies to re-download","Verify the file with 'unzip -t <artifact>' to confirm corruption","Pin dependency versions (avoid mutating SNAPSHOTs during builds) and check proxy/mirror integrity"],"exampleFix":"// before: corrupted jar\nrm ~/.gradle/caches/modules-2/files-2.1/com.example/broken-artifact/\n./gradlew build --refresh-dependencies","handlingStrategy":"try-catch","validationCode":"// check artifact integrity before model resolution\nprocess = Runtime.getRuntime().exec(arrayOf(\"unzip\", \"-t\", artifactPath.toString()))\nif (process.waitFor() != 0) throw IllegalStateException(\"Corrupt jar: $artifactPath\")","typeGuard":null,"tryCatchPattern":"try { /* application model task */ } catch (e: RuntimeException) {\n  if (e.message?.startsWith(\"Failed to process \") == true) {\n    val path = e.message?.removePrefix(\"Failed to process \")\n    // delete File(path) from cache, re-run with --refresh-dependencies\n  } else throw e\n}","preventionTips":["Use --refresh-dependencies after suspected interrupted downloads","Avoid overwriting SNAPSHOT jars mid-build","Pin dependency versions in CI for reproducible artifacts"],"tags":["gradle","classpath","corrupt-artifact","application-model"],"backgroundTag":"corrupt-jar-artifact","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"}