Skip to content

Run post-generation builds through maven-executor instead of maven-invoker - #1034

Merged
slachiewicz merged 1 commit into
masterfrom
agent/maven-executor
Sep 21, 2026
Merged

slachiewicz merged 1 commit into
masterfrom
agent/maven-executor

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

maven-invoker is deprecated in favour of maven-executor (apache/maven-invoker#164). The three places that run Maven build an ExecutorRequest and run it with ForkedMavenExecutor on the installation maven.home points to, which is what the injected Invoker resolved before: the integration-test mojo's post-generation goals, the generate mojo's post-generation goals, and the archetype creator's build of the generated archetype. MavenBuilds in archetype-common holds the two lines shared by all of them.

Two details worth knowing. The executor closes the streams it is given when the build ends, so the streams handed to it are wrappers that only flush: System.out for the mojos that never wrote a log, and the IT build.log, which the verify script keeps printing to after the build. And BuildLog mirrors the build's output to the Maven log line by line from the stream now, instead of through the invoker's InvocationOutputHandler.

Verified: mvn -Prun-its install → 33 ITs passed (6 of them run post-generation goals, all with exit code 0), unit tests 57 passed.

…voker

maven-invoker is deprecated (apache/maven-invoker#164). The three places that
ran Maven, the integration-test and generate mojos and the archetype creator,
build an ExecutorRequest and run it with ForkedMavenExecutor on maven.home,
the same installation the invoker picked.
@slachiewicz slachiewicz added maintenance dependencies Pull requests that update a dependency file labels Sep 21, 2026
@slachiewicz
slachiewicz marked this pull request as ready for review September 21, 2026 12:57
@slachiewicz
slachiewicz merged commit 62e70ba into master Sep 21, 2026
21 checks passed
@slachiewicz
slachiewicz deleted the agent/maven-executor branch September 21, 2026 17:09
@github-actions github-actions Bot added this to the 3.4.2 milestone Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant