Skip to content

Keep the progress number of a project that is built again (fix #10291) - #13577

Merged
gnodet merged 1 commit into
apache:masterfrom
arturobernalg:fix/maven-10291-progress-counter
Oct 19, 2026
Merged

gnodet merged 1 commit into
apache:masterfrom
arturobernalg:fix/maven-10291-progress-counter

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

What and why

mvn package artifact:describe-build-output on a three module project prints [1/3], [2/3], [3/3] and then [4/3]. The aggregator goal on the command line builds the first project once more after the reactor, and the progress counter of ExecutionEventLogger took it for one more project (#10291). I could reproduce it on 3.9.16 and on current master.

How

ExecutionEventLogger remembers the number it gave to each project, and a project that is built again shows that number, so the repeated run of the first module is [1/3]. This matches the report, which describes it as the first module where an aggregator goal has to run. The same change is in the copy of the logger in compat/maven-embedder.

Tests

testMultiModuleProjectBuiltAgainKeepsItsNumber is added to both ExecutionEventLoggerTest classes and fails in maven-cli without the change. maven-cli and maven-embedder pass and spotless is clean. I did not run the integration tests.


To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
check one of the following:

…#10291)

An aggregator goal on the command line builds a project once more after the reactor, and the progress counter took it for one more project, so that the output went past the total, as in [13/12]. A project built again now shows the number it was given the first time.
gnodet pushed a commit to arturobernalg/maven that referenced this pull request Oct 16, 2026
…#10291)

An aggregator goal on the command line builds a project once more after the reactor, and the progress counter took it for one more project, so that the output went past the total, as in [13/12]. A project built again now shows the number it was given the first time.

Backport of apache#13577 to maven-4.0.x.
gnodet pushed a commit that referenced this pull request Oct 19, 2026
#13578)

An aggregator goal on the command line builds a project once more after the reactor, and the progress counter took it for one more project, so that the output went past the total, as in [13/12]. A project built again now shows the number it was given the first time.

Backport of #13577 to maven-4.0.x.
@gnodet gnodet changed the title Keep the progress number of a project that is built again (fix #10291) [Backport maven-3.10.x] Keep the progress number of a project that is built again (fix #10291) Oct 19, 2026
@gnodet gnodet changed the title [Backport maven-3.10.x] Keep the progress number of a project that is built again (fix #10291) Keep the progress number of a project that is built again (fix #10291) Oct 19, 2026
@gnodet gnodet added fix bug Something isn't working and removed fix labels Oct 19, 2026
@gnodet
gnodet merged commit 969f535 into apache:master Oct 19, 2026
42 of 43 checks passed
gnodet pushed a commit that referenced this pull request Oct 19, 2026
#13579)

An aggregator goal on the command line builds a project once more after the reactor, and the progress counter took it for one more project, so that the output went past the total, as in [13/12]. A project built again now shows the number it was given the first time.

Backport of #13577 to maven-3.10.x.
@github-actions github-actions Bot added this to the 4.1.0 milestone Oct 19, 2026
gnodet pushed a commit that referenced this pull request Oct 19, 2026
…built again (#13635)

Backport of #13577 (fix #10291), already backported to maven-4.0.x (#13578)
and maven-3.10.x (#13579) but missing on maven-3.9.x, which has the same
ExecutionEventLogger counter logic.

When an aggregator goal on the command line builds the first project again
after the reactor finished (for instance "mvn package artifact:describe"),
the project progress counter kept incrementing past the total project
count, printing a confusing "[4/3]" instead of repeating "[1/3]".

Remember the progress number already assigned to each project and reuse it
instead of handing out a new one every time projectStarted fires for the
same project.

Fixes #10291
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants