Repository navigation
Forward stdin from the client to the daemon on 1.x - #1941
Merged
Merged
Conversation
(cherry picked from commit 9e32662) Adapted: DaemonInputStream imports the 1.x ProjectBuildLogAppender and Server keeps its Maven 3.9 wiring; the Maven 4 DaemonMavenInvoker change is left out.
(cherry picked from commit a909908) Adapted: PROJECT_TEST_PROGRESS moves from 29 to 31 so REQUEST_INPUT_AVAILABLE (29) and INPUT_AVAILABLE_DATA (30) keep master's type codes; the new test-progress codes are unreleased on 1.x. Optional.isEmpty() becomes !isPresent() for Java 8.
(cherry picked from commit eb5e83d) Applied unchanged.
(cherry picked from commit b6bddf2) Adapted: only the dumb-terminal prompt skip removal and the flush before the answer are ported; the Maven 4 Prompter API switch in DaemonPrompter does not apply to Maven 3.9.
A timed read returns READ_EXPIRED when no input arrived in time. Sending EOF for it closed System.in in the daemon for the rest of the build.
slachiewicz
marked this pull request as ready for review
November 15, 2026 20:48
A mojo that reads System.in to the end waits for the end of input. The test left the pipe open, so the build never finished.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports stdin forwarding from master to
mvnd-1.x: the client sends input to the daemon only when a mojo asks for it (#1268), piped input works (#1648), and prompts work in the daemon (#1303). Plugins that readSystem.inthen work on 1.0.x as they do on 2.x (#541).Two points differ from a plain cherry-pick. The message type
PROJECT_TEST_PROGRESSmoves from 29 to 31, so that 29 and 30 match master'sREQUEST_INPUT_AVAILABLEandINPUT_AVAILABLE_DATA; no release contains the old number. The last commit stops a read timeout from being sent to the daemon as end of input.The ported commits keep their original authors, so merge with "Rebase and merge".
I have not run the native ITs locally, and I have not tested prompts on an interactive terminal.
Verified:
./mvnw -pl integration-tests -am verifyunder JDK 17 → 48 integration tests, 0 failures.