{"record":{"id":"e73395548604f2fd","repo":"quarkusio/quarkus","slug":"failed-to-copy-s-to-s","errorCode":null,"errorMessage":"Failed to copy %s to %s","messagePattern":"Failed to copy (.+?) to (.+?)","errorType":"exception","errorClass":"GradleException","httpStatus":null,"severity":"error","filePath":"devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildDependencies.java","lineNumber":211,"sourceCode":"                        if (!Files.exists(target)) {\n                            getLogger().debug(\"Dependency {} : copying {} to {}\",\n                                    dep.toGACTVString(),\n                                    p, target);\n                            if (Files.isDirectory(p)) {\n                                // This case can happen when we are building a jar from inside the Quarkus repository\n                                // and Quarkus Bootstrap's localProjectDiscovery has been set to true. In such a case\n                                // the non-jar dependencies are the Quarkus dependencies picked up on the file system\n                                try {\n                                    ZipUtils.zip(p, target);\n                                } catch (IOException e) {\n                                    throw new GradleException(\n                                            String.format(\"Failed to archive classes at %s into %s\", p, target), e);\n                                }\n                            } else {\n                                try {\n                                    Files.copy(p, target, StandardCopyOption.COPY_ATTRIBUTES);\n                                } catch (IOException e) {\n                                    throw new GradleException(String.format(\"Failed to copy %s to %s\", p, target), e);\n                                }\n                            }\n                        }\n                    });\n                })\n                .collect(Collectors.toMap(Map.Entry::getKey, depAndTarget -> 1, Integer::sum))\n                .forEach((path, count) -> getLogger().info(\"Copied {} files into {}\", count, path));\n    }\n\n    private static Set<ArtifactKey> dependenciesListToArtifactKeySet(String optionalDependenciesProp) {\n        return Arrays.stream(optionalDependenciesProp.split(\",\"))\n                .map(String::trim)\n                .filter(gact -> !gact.isEmpty())\n                .map(ArtifactKey::fromString)\n                .collect(Collectors.toSet());\n    }\n}\n","sourceCodeStart":193,"sourceCodeEnd":229,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuildDependencies.java#L193-L229","documentation":"For ordinary jar dependencies, jarDependencies copies each jar into the dependency cache with Files.copy using COPY_ATTRIBUTES. If the copy fails with IOException the build fails with this GradleException naming source and target. Commonly a lock, permission, or disk-space problem on either side of the copy.","triggerScenarios":"Files.copy(p, target, COPY_ATTRIBUTES) throws IOException while copying a dependency jar into the build dependency directory during fast-jar/legacy-jar dependency assembly.","commonSituations":"Jar locked by a running dev-mode process or IDE (Windows); read-only local repository or output directory; disk full; source jar deleted by a concurrent Gradle daemon build.","solutions":["Stop running Quarkus dev/lock-holding processes and other Gradle daemons (./gradlew --stop), then rebuild","Verify disk space and write permissions on the dependency output directory","Check the source jar exists and is readable; re-download it by deleting it from the local cache","Run ./gradlew clean quarkusBuild to start from a clean layout"],"exampleFix":"// shell-side remedy\n./gradlew --stop\nrm -rf build/quarkus-build/dependencies\n./gradlew quarkusBuild","handlingStrategy":"retry","validationCode":"File depDir = new File(\"build/quarkus-build/dependencies\");\nif (depDir.exists() && !depDir.canWrite())\n    throw new IllegalStateException(\"Dependency output dir not writable: \" + depDir);","typeGuard":null,"tryCatchPattern":"try {\n    ./gradlew quarkusBuild\n} catch (GradleException e) {\n    if (e.message?.startsWith(\"Failed to copy\") && e.message.contains(\" to \")) {\n        \"./gradlew --stop\".execute().waitFor();\n        deleteDir(new File(\"build/quarkus-build/dependencies\")); retry();\n    } else { throw e; }\n}","preventionTips":["Stop dev-mode processes before rebuilding","Check free disk space before large builds","Keep the local repo writable and unfragmented","Run one Gradle invocation at a time (no parallel daemons)"],"tags":["gradle","io","file-copy","dependencies"],"backgroundTag":"file-copy-failed","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"}