Skip to content

Forward stdin from the client to the daemon on 1.x - #1941

Merged
slachiewicz merged 6 commits into
apache:mvnd-1.xfrom
slachiewicz:stdin-forwarding-1x
Nov 16, 2026
Merged

slachiewicz merged 6 commits into
apache:mvnd-1.xfrom
slachiewicz:stdin-forwarding-1x

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

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 read System.in then 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_PROGRESS moves from 29 to 31, so that 29 and 30 match master's REQUEST_INPUT_AVAILABLE and INPUT_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 verify under JDK 17 → 48 integration tests, 0 failures.

gnodet and others added 5 commits November 15, 2026 20:10
(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 slachiewicz added backport backport to a maintenance branch enhancement New feature or request labels Nov 15, 2026
@slachiewicz
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.
@slachiewicz
slachiewicz merged commit 9a518a7 into apache:mvnd-1.x Nov 16, 2026
9 checks passed
@github-actions github-actions Bot added this to the 1.0.7 milestone Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport backport to a maintenance branch enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants