{"record":{"id":"c2ef0f5c163f8592","repo":"quarkusio/quarkus","slug":"failed-to-generate-quarkus-project","errorCode":null,"errorMessage":"Failed to generate Quarkus project","messagePattern":"Failed to generate Quarkus project","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"critical","filePath":"devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java","lineNumber":351,"sourceCode":"\n            success = createProject.execute().isSuccess();\n            if (success && parentPomModel != null && BuildTool.MAVEN.equals(buildToolEnum)) {\n                // Write to parent pom and submodule pom if project creation is successful\n                if (!parentPomModel.getModules().contains(this.projectArtifactId)) {\n                    parentPomModel.addModule(this.projectArtifactId);\n                }\n                File subModulePomFile = new File(projectRoot, buildToolEnum.getDependenciesFile());\n                Model subModulePomModel = MojoUtils.readPom(subModulePomFile);\n                Parent parent = new Parent();\n                parent.setGroupId(parentPomModel.getGroupId());\n                parent.setArtifactId(parentPomModel.getArtifactId());\n                parent.setVersion(parentPomModel.getVersion());\n                subModulePomModel.setParent(parent);\n                MojoUtils.writeFormatted(parentPomModel, pom);\n                MojoUtils.writeFormatted(subModulePomModel, subModulePomFile);\n            }\n        } catch (Exception e) {\n            throw new MojoExecutionException(\"Failed to generate Quarkus project\", e);\n        }\n        if (success) {\n            printUserInstructions(projectRoot);\n        } else {\n            throw new MojoExecutionException(\n                    \"The project was created but (some of) the requested extensions couldn't be added.\");\n        }\n    }\n\n    private ExtensionCatalogResolver getExtensionCatalogResolver(MavenArtifactResolver mvn, MojoMessageWriter log) {\n        if (!QuarkusProjectHelper.isRegistryClientEnabled()) {\n            return ExtensionCatalogResolver.empty();\n        }\n        ExtensionCatalogResolver catalogResolver;\n        try {\n            catalogResolver = QuarkusProjectHelper.getCatalogResolver(mvn, log);\n            if (refresh) {\n                getLog().debug(\"Clearing local extension catalog cache\");","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java#L333-L369","documentation":"CreateProjectMojo.execute wraps the entire project generation (template rendering, POM writing, file creation) in a broad try/catch and rethrows any Exception as a MojoExecutionException with this message. It means the Maven 'quarkus:create' goal failed while materializing the new Quarkus project on disk. The original cause is attached, so the root problem (IO error, template failure, bad coordinates) is in the 'Caused by' chain.","triggerScenarios":"Running `mvn io.quarkus:quarkus-maven-plugin:create ...` where any exception occurs during project generation: unresolvable parent artifacts, inability to write files, template resource failures, or any unexpected exception inside the execute() body before the success flag is checked.","commonSituations":"Read-only or existing non-empty target directory; corrupted local Maven repository causing artifact resolution failure; wrong -DprojectGroupId/-DprojectVersion values; proxy or repository misconfiguration blocking downloads of the platform BOM.","solutions":["Read the full 'Caused by' chain of the MojoExecutionException to find the real cause","Verify the target directory exists, is writable, and does not already contain a conflicting project","Run with -e (show stack trace) and -U (force update) to refresh resolution of quarkus-bom artifacts","Check Maven settings.xml repositories/mirrors/proxy configuration","Retry after clearing the specific corrupted artifact under ~/.m2/repository"],"exampleFix":"# before\ncd /existing-project && mvn quarkus:create\n# after: run in an empty directory or specify a fresh dir\nmkdir my-app && cd my-app && mvn io.quarkus.platform:quarkus-maven-plugin:create -DprojectArtifactId=my-app","handlingStrategy":"try-catch","validationCode":"// Pre-checks before running create\nPath target = Path.of(dir);\nif (Files.exists(target) && !isEmptyDirectory(target)) throw new IllegalStateException(\"Target dir not empty: \" + dir);\nif (!Files.isWritable(target.getParent())) throw new IllegalStateException(\"Not writable: \" + target.getParent());","typeGuard":null,"tryCatchPattern":"// Maven CLI: no code-level catch; inspect cause chain\nmvn quarkus:create -e\n// In Mojo code: MojoExecutionException has a cause — always log/inspect getCause() recursively","preventionTips":["Run create in a fresh empty directory","Check target directory writability before invoking","Keep ~/.m2 healthy; use -U after network issues","Verify Maven settings.xml repositories and proxy"],"tags":["maven","project-generation","quarkus-create"],"backgroundTag":"maven-goal-execution-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"}