{"record":{"id":"fb957c4ec07981d0","repo":"quarkusio/quarkus","slug":"failed-to-create-classesdir","errorCode":null,"errorMessage":"Failed to create <classesDir>","messagePattern":"Failed to create <classesDir>","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/GoOfflineMojo.java","lineNumber":159,"sourceCode":"        if (artifact != null) {\n            final LocalProject module = workspace.getProject(artifact.getGroupId(), artifact.getArtifactId());\n            if (module != null && !module.getRawModel().getPackaging().equals(ArtifactCoords.TYPE_POM)) {\n                final Path classesDir;\n                if (artifact.getClassifier().equals(ArtifactSources.TEST)) {\n                    classesDir = module.getTestClassesDir();\n                } else {\n                    classesDir = module.getClassesDir();\n                }\n                if (!Files.exists(classesDir)) {\n                    Path topDirToCreate = classesDir;\n                    while (!Files.exists(topDirToCreate.getParent())) {\n                        topDirToCreate = topDirToCreate.getParent();\n                    }\n                    try {\n                        Files.createDirectories(classesDir);\n                        createdDirs.add(topDirToCreate);\n                    } catch (IOException e) {\n                        throw new MojoExecutionException(\"Failed to create \" + classesDir, e);\n                    }\n                }\n            }\n        }\n        for (DependencyNode c : node.getChildren()) {\n            ensureResolvableModule(c, workspace, createdDirs);\n        }\n    }\n}\n","sourceCodeStart":141,"sourceCodeEnd":169,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/GoOfflineMojo.java#L141-L169","documentation":"ensureResolvableModule walks the dependency tree and creates target/classes directories for workspace modules whose output dirs are missing so artifacts become resolvable. If Files.createDirectories fails with an IOException, this MojoExecutionException is thrown wrapping it.","triggerScenarios":"Running `mvn quarkus:go-offline` when a module's target/classes path cannot be created — typically a filesystem permission problem, path is actually a file, or read-only filesystem.","commonSituations":"Running the build as a different user than the workspace owner; Docker container with read-only volume; SELinux/AppArmor denials; disk full on CI runners.","solutions":["Check filesystem permissions on the project target/ directories and fix ownership","Verify the path is not an existing regular file (delete it if so)","Free disk space if the disk is full","Run the build inside the same user context that owns the workspace","Check container/SELinux policies if on a restricted system"],"exampleFix":"// before\n$ mvn quarkus:go-offline  # fails creating module/target/classes\n// after\n$ sudo chown -R $(whoami) . && mvn quarkus:go-offline","handlingStrategy":"validation","validationCode":"// pre-check target dir writability\nPath target = Path.of(\"target\");\nif (Files.exists(target) && !Files.isWritable(target)) {\n    throw new IllegalStateException(\"target/ is not writable: \" + target);\n}\nif (Files.exists(target) && !Files.isDirectory(target)) {\n    throw new IllegalStateException(\"target exists but is not a directory\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run builds as the workspace owner, not root mixing","Ensure CI containers mount the workspace read-write","Check disk space before large builds","mvn clean when target state is suspect"],"tags":["maven","filesystem","io"],"backgroundTag":"filesystem-permission-denied","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"}