quarkusio/quarkus · error · QuarkusCommandException

Error while creating Quarkus extension: ${message}

Error message

Error while creating Quarkus extension: ${message}

What it means

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.

Source

Thrown at independent-projects/tools/devtools-common/src/main/java/io/quarkus/devtools/commands/handlers/CreateExtensionCommandHandler.java:95

                updateITParentPomAndMoveDir(extensionDirName, newExtensionDir, itTestParentDir);
                log.info(MessageIcons.SUCCESS_ICON + " New integration test module '%s' added to %s", extensionDirName,
                        itTestParentDir);
            }

            if (bomDir != null) {
                updateBom(groupId, artifactId, bomDir);
                log.info(MessageIcons.SUCCESS_ICON
                        + " The extension runtime and deployment artifacts have been added to the bom dependenciesManagement: %s",
                        bomDir);
            }

            log.info("\n-----------\n" + MessageIcons.NOOP_ICON +
                    " extension has been successfully generated in:\n--> "
                    + newExtensionDir.toString() + "\n-----------");

            return QuarkusCommandOutcome.success();
        } catch (IOException e) {
            throw new QuarkusCommandException("Error while creating Quarkus extension: " + e.getMessage(), e);
        }
    }

    public Map<String, Object> getData() {
        return Collections.unmodifiableMap(input.getData());
    }

    private void updateBom(String groupId, String artifactId, Path bomDir) throws QuarkusCommandException {
        final Path bomPom = checkPomExists(bomDir);
        List<PomTransformer.Transformation> transformations = new ArrayList<>();
        transformations.add(PomTransformer.Transformation.addManagedDependency(groupId, artifactId,
                "${project.version}"));
        transformations.add(PomTransformer.Transformation.addManagedDependency(groupId, artifactId + "-deployment",
                "${project.version}"));
        new PomTransformer(bomPom, StandardCharsets.UTF_8).transform(transformations);
    }

    private void updateITParentPomAndMoveDir(String extensionDirName, Path newExtensionDir, Path itTestDir)

View on GitHub (pinned to e1c734241f)

Solutions

  1. Read the embedded message and cause for the exact IO failure
  2. Remove any partially generated extension directory and retry
  3. Ensure the target directory tree is writable
  4. Check that a prior failed run did not leave locked/open files (Windows)
Defensive patterns

Strategy: try-catch

Validate before calling

Path target = Path.of(outputRoot);
if (!Files.isDirectory(target) || !Files.isWritable(target)) throw new IllegalStateException("Output root missing or not writable: " + target);

Try / catch

try { handler.execute(invocation); } catch (QuarkusCommandException e) { log.error("Extension generation failed: " + e.getMessage(), e.getCause()); }

Prevention

When it happens

Trigger: Running the create-extension command when template copy/codestart generation fails: target dir unwritable, files already exist, or resource templates cannot be read.

Common situations: Creating an extension inside a read-only checkout; target directory partially exists from a previous failed run; missing codestart resources on the classpath.

Related errors


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