Skip to content

Fix #185: aggregate goal only collects this project's own modules - #369

Merged
slawekjaranowski merged 3 commits into
apache:masterfrom
arturobernalg:fix/issue-185-aggregate-sibling-pollution
Dec 1, 2026
Merged

slawekjaranowski merged 3 commits into
apache:masterfrom
arturobernalg:fix/issue-185-aggregate-sibling-pollution

Conversation

@arturobernalg

Copy link
Copy Markdown
Member

AggregatorSourceJarMojo packaged sources from reactorProjects, the full list of every project in the current build, rather than just this project's own descendants. Binding the aggregate goal in two sibling aggregator POMs (e.g. a client and a server subtree under a common parent) made each one's sources jar pull in the other's sources whenever both were built together as part of the larger reactor, even though neither is a module of the other.

Use getCollectedProjects() instead, which is exactly this project's own module tree regardless of what else is in the reactor, so the resulting archive no longer depends on how the build was invoked.

Added IT MSOURCES-115: a three-level reactor (parent, two aggregator siblings, one leaf module under each) building the whole tree, and checking each sibling's sources jar contains only its own leaf's source and not the other sibling's.

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

Comment thread src/it/MSOURCES-115/verify.groovy Resolved
arturobernalg and others added 2 commits December 1, 2026 23:01
AggregatorSourceJarMojo packaged sources from reactorProjects, the full
list of every project in the current build, rather than just this
project's own descendants. Binding the aggregate goal in two sibling
aggregator POMs (e.g. a client and a server subtree under a common
parent) made each one's sources jar pull in the other's sources
whenever both were built together as part of the larger reactor, even
though neither is a module of the other.

Use getCollectedProjects() instead, which is exactly this project's
own module tree regardless of what else is in the reactor, so the
resulting archive no longer depends on how the build was invoked.

Added IT MSOURCES-115: a three-level reactor (parent, two aggregator
siblings, one leaf module under each) building the whole tree, and
checking each sibling's sources jar contains only its own leaf's
source and not the other sibling's.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slawekjaranowski
slawekjaranowski force-pushed the fix/issue-185-aggregate-sibling-pollution branch from e8381cb to c02b846 Compare December 1, 2026 22:05
The aggregate goal now uses the project's collected modules, so nothing
reads reactorProjects any more.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@slawekjaranowski
slawekjaranowski merged commit ccc4948 into apache:master Dec 1, 2026
14 checks passed
@slawekjaranowski slawekjaranowski added the bug Something isn't working label Dec 1, 2026
@github-actions github-actions Bot added this to the 3.4.1 milestone Dec 1, 2026
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.

[MSOURCES-115] aggregate-sources yields different results based on reactor

2 participants