apache / apache/maven

[MNG-7991] refactor "aggregator" goal feature

Open
#8,718 0 comments 0 reactions 0 assignees View on GitHub
priority:major
Dominant language
Java
Stars
5.3k
Forks
3.1k
Avg merge
20h 42m
Merged PRs (30d)
297

Description

**[Hervé Boutemy](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=hboutemy)** opened **[MNG-7991](https://issues.apache.org/jira/browse/MNG-7991?redirect=false)** and commented

aggregation was added in early Maven 2 stages with MNG-250, not really documented AFAIK, but highly visible through [@Mojo(aggregator=true) Mojo annotation](https://maven.apache.org/plugin-tools/maven-plugin-tools-annotations/index.html)

there are multiple shortcomings found over time:
* discrepancy between CLI and lifecycle use:
* CLI executes aggregator-marked goal **only on root module** (skips goal execution in sub-modules) and **after executing the lifecycle** to all modules
* lifecycle-bound goal executes goal on each and every module, during normal lifecycle run on each module: not even sure aggregator configuration changes anything

* forked lifecycle execution vs second execution in modules

* sometimes, instead of executing aggregate goal **before** building modules, it would be useful to execute aggregate **after** building modules (to aggregate some results built in each module)
notice that this looks also like the need for "execute at end" as found in install/deploy

we probably need to better document what aggregate currently does and define what should be the target: perhaps refactoring will require new mechanisms that we won't call aggregator, like MNG-5665...

edge case: aggregating reports for maven-site-plugin (launched by maven-reporting-exec, hence quite independent from associated reporting goals even if we expect some consistency between site reports and reporting goals)

---

**Affects:** 4.x / Backlog

**Issue Links:**
- [MNG-2184](https://issues.apache.org/jira/browse/MNG-2184) Possible problem with `@aggregator` and forked lifecycles
(_**"contains"**_)
- [MNG-6336](https://issues.apache.org/jira/browse/MNG-6336) Aggregator Mojo should be executed only once even when part of the lifecycle
(_**"incorporates"**_)
- [MNG-250](https://issues.apache.org/jira/browse/MNG-250) make aggregation feasible
(_**"is caused by"**_)
- [MNG-5665](https://issues.apache.org/jira/browse/MNG-5665) Advanced Lifecycle Handling

- [MNG-7163](https://issues.apache.org/jira/browse/MNG-7163) Aggregating Mojo re-executes goals for child modules that are already executed

- [MNG-7672](https://issues.apache.org/jira/browse/MNG-7672) Aggregate goals executed in a submodule forks the whole reactor

- [MNG-2180](https://issues.apache.org/jira/browse/MNG-2180) Allow aggregation mojos to access plugin configurations

- [MNG-4504](https://issues.apache.org/jira/browse/MNG-4504) Disallowing all aggregator bindings to any lifecycle is too broad

- [MNG-8337](https://issues.apache.org/jira/browse/MNG-8337) aggregator goal called from CLI shows an additional module at end (= first module twice)

- [MNG-7900](https://issues.apache.org/jira/browse/MNG-7900) wrapper lifecycle in multi module project should be executed only in root module

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.