{"record":{"id":"c1a68bf320da7ab3","repo":"quarkusio/quarkus","slug":"unable-to-get-user-input-c1a68b","errorCode":null,"errorMessage":"Unable to get user input","messagePattern":"Unable to get user input","errorType":"exception","errorClass":"MojoExecutionException","httpStatus":null,"severity":"error","filePath":"devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java","lineNumber":489,"sourceCode":"                prompter.addPrompt(\"Set the project version: \", DEFAULT_VERSION, input -> projectVersion = input);\n            }\n\n            if (!noCode && isBlank(example)) {\n                if (extensions.isEmpty()) {\n                    prompter.addPrompt(\"What extensions do you wish to add (comma separated list): \", DEFAULT_EXTENSIONS,\n                            input -> extensions = Arrays\n                                    .stream(input.split(\",\"))\n                                    .map(String::trim).filter(Predicate.not(String::isEmpty)).collect(Collectors.toSet()));\n                }\n                prompter.addPrompt(\"Would you like some code to start (yes), or just an empty Quarkus project (no): \", \"yes\",\n                        input -> noCode = input.startsWith(\"n\"));\n\n                prompter.collectInput();\n            } else {\n                setProperDefaults();\n            }\n        } catch (IOException e) {\n            throw new MojoExecutionException(\"Unable to get user input\", e);\n        }\n    }\n\n    private void setProperDefaults() {\n        if (isBlank(projectArtifactId)) {\n            // we need to set it for the project directory\n            projectArtifactId = DEFAULT_ARTIFACT_ID;\n        }\n        if (isBlank(projectGroupId)) {\n            projectGroupId = DEFAULT_GROUP_ID;\n        }\n        if (isBlank(projectVersion)) {\n            projectVersion = DEFAULT_VERSION;\n        }\n    }\n\n    private boolean shouldUseDefaults() {\n        // Must be called before user input","sourceCodeStart":471,"sourceCodeEnd":507,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java#L471-L507","documentation":"When the 'create' goal runs in interactive mode (no -B), it calls prompter.collectInput() to read answers for missing project values (groupId, artifactId, version, etc.). Any IOException from that interaction is wrapped in this MojoExecutionException 'Unable to get user input'. It indicates the console/stdin interaction failed rather than any project-level problem.","triggerScenarios":"Running `mvn quarkus:create` (interactive) with stdin closed or redirected from a non-tty source that errors, e.g. `< /dev/null` in some environments, a dead CI pipe, or terminal I/O failure during prompter.collectInput().","commonSituations":"Running interactive create inside CI/CD without -B (batch mode); wrapping Maven in scripts that close stdin; IDE terminals with broken tty; Docker/podman run without -t.","solutions":["Run in batch mode and supply all values as properties: mvn quarkus:create -B -DprojectGroupId=... -DprojectArtifactId=... -DprojectVersion=... -Dextensions=...","Ensure stdin is an interactive terminal when you want prompts (docker run -t, don't redirect from /dev/null)","Check that the shell/CI runner actually provides a TTY to Maven"],"exampleFix":"# before (CI, stdin closed)\nmvn quarkus:create\n# after\nmvn quarkus:create -B -DprojectGroupId=com.acme -DprojectArtifactId=demo -DprojectVersion=1.0.0-SNAPSHOT -Dextensions=rest","handlingStrategy":"validation","validationCode":"# Guarantee non-interactive success: pass -B plus every required value\n[ -t 0 ] || [ -n \"$CI\" ] && exec mvn quarkus:create -B -DprojectGroupId=$G -DprojectArtifactId=$A -DprojectVersion=$V -Dextensions=$EXTS","typeGuard":null,"tryCatchPattern":"// In scripts wrapping Maven, detect missing TTY and switch to batch mode\nif [ ! -t 0 ]; then set -- \"$@\" -B; fi","preventionTips":["Always use -B with all -Dproject* properties in CI","Use docker run -t only when you actually want interactive prompts","Do not redirect stdin from /dev/null for interactive Maven goals","Document required properties so interactive mode is rarely needed"],"tags":["maven","interactive-input","console-io"],"backgroundTag":"missing-user-input","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"}