{"record":{"id":"cf08fd470a0d1767","repo":"apache/maven","slug":"unable-to-showmessage","errorCode":null,"errorMessage":"Unable to showMessage","messagePattern":"Unable to showMessage","errorType":"exception","errorClass":"PrompterException","httpStatus":null,"severity":"error","filePath":"compat/maven-compat/src/main/java/org/apache/maven/internal/compat/interactivity/LegacyPlexusInteractivity.java","lineNumber":147,"sourceCode":"            throw new PrompterException(\"Unable to prompt\", e);\n        }\n    }\n\n    @Override\n    public String promptForPassword(String message) throws PrompterException {\n        try {\n            return prompter.promptForPassword(message);\n        } catch (org.apache.maven.api.services.PrompterException e) {\n            throw new PrompterException(\"Unable to promptForPassword\", e);\n        }\n    }\n\n    @Override\n    public void showMessage(String message) throws PrompterException {\n        try {\n            prompter.showMessage(message);\n        } catch (org.apache.maven.api.services.PrompterException e) {\n            throw new PrompterException(\"Unable to showMessage\", e);\n        }\n    }\n}\n","sourceCodeStart":129,"sourceCodeEnd":151,"githubUrl":"https://github.com/apache/maven/blob/e4093d4e120eac99d6bdce5ba67cace2f3085c97/compat/maven-compat/src/main/java/org/apache/maven/internal/compat/interactivity/LegacyPlexusInteractivity.java#L129-L151","documentation":"Thrown when displaying a message through the legacy interactivity adapter fails. LegacyPlexusInteractivity.showMessage() calls prompter.showMessage(message) and wraps any org.apache.maven.api.services.PrompterException in a legacy PrompterException ('Unable to showMessage'). It is write-only output, so failure means the output side of the console (stdout/stderr writer) threw, not user input.","triggerScenarios":"Calling showMessage(String) when the underlying Prompter's output stream fails: closed stdout, broken pipe (output piped to a consumer that exited), or disk/full-buffer I/O error on a redirected stream.","commonSituations":"Piping Maven output to head/less and the consumer exits early (SIGPIPE); legacy plugins printing progress via the Plexus Prompter in redirected or daemonized environments; embedding Maven where System.out has been closed.","solutions":["Check that stdout/stderr of the process is open and consumers of a pipe stay alive for the whole run","Avoid showMessage for bulk output; use the logger, which tolerates stream failures better","Catch PrompterException around display calls in legacy adapters and degrade to a no-op or log","Do not close System.out in embedded/daemon usage before Maven finishes"],"exampleFix":"// before\nprompter.showMessage(\"Important notice\");\n// after\ntry {\n    prompter.showMessage(\"Important notice\");\n} catch (PrompterException e) {\n    logger.warn(\"Could not display message to user: {}\", e.getMessage());\n}","handlingStrategy":"try-catch","validationCode":"// Ensure the process output stream is usable before display-heavy flows\nboolean outputOk = System.out != null && !System.out.checkError();","typeGuard":null,"tryCatchPattern":"try {\n    prompter.showMessage(message);\n} catch (PrompterException e) {\n    logger.debug(\"showMessage failed; continuing\", e); // display is non-critical\n}","preventionTips":["Treat showMessage as best-effort; do not let display failures abort the build","Use a logger instead of the prompter for informational output","In pipes, keep the downstream consumer alive until the build exits"],"tags":["maven","interactivity","output","legacy","broken-pipe"],"backgroundTag":"interactive-prompt-unavailable","analyzedSha":"e4093d4e120eac99d6bdce5ba67cace2f3085c97","analyzedAt":"2026-08-21T22:58:24.034Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}