...
Since the only truly safe way to run an aggregator mojo is from the command line, proper use of this feature serves to destroy the controlled vocabulary that helps to make Maven a compellingly portable tool. It also raises serious concerns about how to configure the aggregator mojo in a portable way, with the only clear way being an entry in the pluginManagement section of the top-level POM. Since the definition of "top-level POM" can vary according to whether you're building a project, product containing the project, distribution containing both, etc, this still leaves open the possibility of conflicting aggregator configurations within a single build.
Proposed changes for 2.1
Deprecate @aggregator and
...
further develop child-processing and child-summary support
...
from parent POMs
...
Introduce a new, special phase
...
: summarize
This might be implemented as a special isSummaryPhase() flag for lifecycle - phase specification, to allow introduction of multiple post-child phases. Pre-child processing can take place in the normal parent phase bindings, since parents will be forced to the head of the line, ahead of children (see The Parent Problem, above). Summary phases that are not specified at the end of the lifecycle would be parsed as runtime (core coding) errors
Implications
One serious implication of this change is that it would require Maven to track parent-child relationships within the reactor. This is critical to enable Maven to wait until the last descendant project of a particular POM has been built, before calling the new special summary phase.
Criteria for the execution of this new phase would be the same as other phases. That is, it would require that all preceding steps (phases/mojos) succeed. Failure ahead of this phase - if not configured using something like --fail-never - would prevent the summary phase from executing.
${subProjects} expression
...
Backward-compat considerations
TODOLegacy @aggregator mojos should be supported, at least for 2.1. However, their use should prompt a deprecation warning to the user.
Build Introspection
This is the ability to query the build for the set of changes it will make to the build state. It's useful for things like IDE tooling, eclipse:eclipse, and clean:clean, since it would allow the user to discover which additional resources it should pay attention to. In the case of IDE tooling, it would allow for addition of new source folder definitions corresponding to generated-source target directories and so forth. In the case of clean:clean, it would allow the plugin to determine which directories (outside of target/, that is) it should clear when it executes.
...