Run post-generation builds through maven-executor instead of maven-invoker - #1034
Merged
Merged
Conversation
…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
marked this pull request as ready for review
September 21, 2026 12:57
This was referenced Sep 21, 2026
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.
maven-invoker is deprecated in favour of maven-executor (apache/maven-invoker#164). The three places that run Maven build an
ExecutorRequestand run it withForkedMavenExecutoron the installationmaven.homepoints to, which is what the injectedInvokerresolved before: theintegration-testmojo's post-generation goals, thegeneratemojo's post-generation goals, and the archetype creator's build of the generated archetype.MavenBuildsin 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.outfor the mojos that never wrote a log, and the ITbuild.log, which the verify script keeps printing to after the build. AndBuildLogmirrors the build's output to the Maven log line by line from the stream now, instead of through the invoker'sInvocationOutputHandler.Verified:
mvn -Prun-its install→ 33 ITs passed (6 of them run post-generation goals, all with exit code 0), unit tests 57 passed.