{"record":{"id":"7cfce8b44034e6ca","repo":"quarkusio/quarkus","slug":"error-while-creating-quarkus-extension-message","errorCode":null,"errorMessage":"Error while creating Quarkus extension: ${message}","messagePattern":"Error while creating Quarkus extension: (.+?)","errorType":"exception","errorClass":"QuarkusCommandException","httpStatus":null,"severity":"error","filePath":"independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateExtensionCommandHandler.java","lineNumber":95,"sourceCode":"                updateITParentPomAndMoveDir(extensionDirName, newExtensionDir, itTestParentDir);\n                log.info(MessageIcons.SUCCESS_ICON + \" New integration test module '%s' added to %s\", extensionDirName,\n                        itTestParentDir);\n            }\n\n            if (bomDir != null) {\n                updateBom(groupId, artifactId, bomDir);\n                log.info(MessageIcons.SUCCESS_ICON\n                        + \" The extension runtime and deployment artifacts have been added to the bom dependenciesManagement: %s\",\n                        bomDir);\n            }\n\n            log.info(\"\\n-----------\\n\" + MessageIcons.NOOP_ICON +\n                    \" extension has been successfully generated in:\\n--> \"\n                    + newExtensionDir.toString() + \"\\n-----------\");\n\n            return QuarkusCommandOutcome.success();\n        } catch (IOException e) {\n            throw new QuarkusCommandException(\"Error while creating Quarkus extension: \" + e.getMessage(), e);\n        }\n    }\n\n    public Map<String, Object> getData() {\n        return Collections.unmodifiableMap(input.getData());\n    }\n\n    private void updateBom(String groupId, String artifactId, Path bomDir) throws QuarkusCommandException {\n        final Path bomPom = checkPomExists(bomDir);\n        List<PomTransformer.Transformation> transformations = new ArrayList<>();\n        transformations.add(PomTransformer.Transformation.addManagedDependency(groupId, artifactId,\n                \"${project.version}\"));\n        transformations.add(PomTransformer.Transformation.addManagedDependency(groupId, artifactId + \"-deployment\",\n                \"${project.version}\"));\n        new PomTransformer(bomPom, StandardCharsets.UTF_8).transform(transformations);\n    }\n\n    private void updateITParentPomAndMoveDir(String extensionDirName, Path newExtensionDir, Path itTestDir)","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateExtensionCommandHandler.java#L77-L113","documentation":"CreateExtensionCommandHandler.execute wraps IOException from generating the new extension skeleton into QuarkusCommandException('Error while creating Quarkus extension: ' + e.getMessage()). The message embeds the underlying IOException text.","triggerScenarios":"Running the create-extension command when template copy/codestart generation fails: target dir unwritable, files already exist, or resource templates cannot be read.","commonSituations":"Creating an extension inside a read-only checkout; target directory partially exists from a previous failed run; missing codestart resources on the classpath.","solutions":["Read the embedded message and cause for the exact IO failure","Remove any partially generated extension directory and retry","Ensure the target directory tree is writable","Check that a prior failed run did not leave locked/open files (Windows)"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"Path target = Path.of(outputRoot);\nif (!Files.isDirectory(target) || !Files.isWritable(target)) throw new IllegalStateException(\"Output root missing or not writable: \" + target);","typeGuard":null,"tryCatchPattern":"try { handler.execute(invocation); } catch (QuarkusCommandException e) { log.error(\"Extension generation failed: \" + e.getMessage(), e.getCause()); }","preventionTips":["Start from a clean output directory (remove partial runs)","Verify write permissions on the extension root tree","Run inside a clean git worktree so failures are easy to revert","Don't run from read-only CI checkouts"],"tags":["io","scaffolding","extension-generation"],"backgroundTag":"project-generation-io-error","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}