quarkusio/quarkus · error · MojoExecutionException

Unable to get user input

Error message

Unable to get user input

What it means

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.

Source

Thrown at devtools/maven/src/main/java/io/quarkus/maven/CreateProjectMojo.java:489

                prompter.addPrompt("Set the project version: ", DEFAULT_VERSION, input -> projectVersion = input);
            }

            if (!noCode && isBlank(example)) {
                if (extensions.isEmpty()) {
                    prompter.addPrompt("What extensions do you wish to add (comma separated list): ", DEFAULT_EXTENSIONS,
                            input -> extensions = Arrays
                                    .stream(input.split(","))
                                    .map(String::trim).filter(Predicate.not(String::isEmpty)).collect(Collectors.toSet()));
                }
                prompter.addPrompt("Would you like some code to start (yes), or just an empty Quarkus project (no): ", "yes",
                        input -> noCode = input.startsWith("n"));

                prompter.collectInput();
            } else {
                setProperDefaults();
            }
        } catch (IOException e) {
            throw new MojoExecutionException("Unable to get user input", e);
        }
    }

    private void setProperDefaults() {
        if (isBlank(projectArtifactId)) {
            // we need to set it for the project directory
            projectArtifactId = DEFAULT_ARTIFACT_ID;
        }
        if (isBlank(projectGroupId)) {
            projectGroupId = DEFAULT_GROUP_ID;
        }
        if (isBlank(projectVersion)) {
            projectVersion = DEFAULT_VERSION;
        }
    }

    private boolean shouldUseDefaults() {
        // Must be called before user input

View on GitHub (pinned to e1c734241f)

Solutions

  1. Run in batch mode and supply all values as properties: mvn quarkus:create -B -DprojectGroupId=... -DprojectArtifactId=... -DprojectVersion=... -Dextensions=...
  2. Ensure stdin is an interactive terminal when you want prompts (docker run -t, don't redirect from /dev/null)
  3. Check that the shell/CI runner actually provides a TTY to Maven

Example fix

# before (CI, stdin closed)
mvn quarkus:create
# after
mvn quarkus:create -B -DprojectGroupId=com.acme -DprojectArtifactId=demo -DprojectVersion=1.0.0-SNAPSHOT -Dextensions=rest
Defensive patterns

Strategy: validation

Validate before calling

# Guarantee non-interactive success: pass -B plus every required value
[ -t 0 ] || [ -n "$CI" ] && exec mvn quarkus:create -B -DprojectGroupId=$G -DprojectArtifactId=$A -DprojectVersion=$V -Dextensions=$EXTS

Try / catch

// In scripts wrapping Maven, detect missing TTY and switch to batch mode
if [ ! -t 0 ]; then set -- "$@" -B; fi

Prevention

When it happens

Trigger: 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().

Common situations: 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.

Related errors


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