quarkusio/quarkus · error · RuntimeException

Failed to process + artifactPath

Error message

Failed to process + artifactPath

What it means

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.

Source

Thrown at devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusApplicationModelTask.java:684

        public File getFile() {
            return file;
        }
    }

    private static boolean processQuarkusDependency(ResolvedDependencyBuilder artifactBuilder,
            ApplicationModelBuilder modelBuilder) {
        for (Path artifactPath : artifactBuilder.getResolvedPaths()) {
            if (!Files.exists(artifactPath) || !artifactBuilder.getType().equals(ArtifactCoords.TYPE_JAR)) {
                break;
            }
            if (Files.isDirectory(artifactPath)) {
                return processQuarkusDir(artifactBuilder, artifactPath.resolve(BootstrapConstants.META_INF), modelBuilder);
            } else {
                try (FileSystem artifactFs = ZipUtils.newFileSystem(artifactPath)) {
                    return processQuarkusDir(artifactBuilder, artifactFs.getPath(BootstrapConstants.META_INF),
                            modelBuilder);
                } catch (IOException e) {
                    throw new RuntimeException("Failed to process " + artifactPath, e);
                }
            }
        }
        return false;
    }

    private static boolean processQuarkusDir(ResolvedDependencyBuilder artifactBuilder, Path quarkusDir,
            ApplicationModelBuilder modelBuilder) {
        if (!Files.exists(quarkusDir)) {
            return false;
        }
        final Path quarkusDescr = quarkusDir.resolve(BootstrapConstants.DESCRIPTOR_FILE_NAME);
        if (!Files.exists(quarkusDescr)) {
            return false;
        }
        final Properties extProps = readDescriptor(quarkusDescr);
        if (extProps == null) {
            return false;

View on GitHub (pinned to e1c734241f)

Solutions

  1. Delete the reported artifactPath from ~/.gradle/caches/modules-2 (or the local repo) and re-run with --refresh-dependencies to re-download
  2. Verify the file with 'unzip -t <artifact>' to confirm corruption
  3. Pin dependency versions (avoid mutating SNAPSHOTs during builds) and check proxy/mirror integrity

Example fix

// before: corrupted jar
rm ~/.gradle/caches/modules-2/files-2.1/com.example/broken-artifact/
./gradlew build --refresh-dependencies
Defensive patterns

Strategy: try-catch

Validate before calling

// check artifact integrity before model resolution
process = Runtime.getRuntime().exec(arrayOf("unzip", "-t", artifactPath.toString()))
if (process.waitFor() != 0) throw IllegalStateException("Corrupt jar: $artifactPath")

Try / catch

try { /* application model task */ } catch (e: RuntimeException) {
  if (e.message?.startsWith("Failed to process ") == true) {
    val path = e.message?.removePrefix("Failed to process ")
    // delete File(path) from cache, re-run with --refresh-dependencies
  } else throw e
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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