GitHub user dbmeneses opened a pull request:
https://github.com/apache/maven/pull/125
[MNG-5965] Parallel build multiplies work if multiple goals are given
This p/r should also fix MNG-5705.
When multiple tasks are given so that they are grouped in different task
segments, the MultiThreadedBuilder fails.
The reason is that it creates project segments, which is a set of unique
pairs of (module, task).
It then handles each task separately, and it will schedules the build of
the task for **all** root module in those pairs, instead of scheduling only the
root module which are associated with that particular task.
Example, given the project with the following hierarchy of modules:
```
root
-- module1
```
If we run `mvn task1 task2`, being task2 an aggregating task, we get the
following project segments:
(task1, root), (task1, module1), (task2, root).
The MultiThreadedBuilder will first handle task1, and will schedule the
build of: (task1, root), (task1, root).
Each of these builds will then recursively build it's children, meaning
that _task1 will be executed twice for every module in the project_.
This fix changes the builder so that it considers the project segments of
each task segment separately, by creating a ConcurrencyDependencyGraph for each
task segment.
I believe that MNG-5705 is a consequence of the same problem, because the
builder will not count correctly the number of projects that are built because
of the shared ConcurrencyDependencyGraph, resulting in a NPE.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dbmeneses/maven master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/maven/pull/125.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #125
----
commit 9518bb247bb5c9dbc267cdaa3407618178aad1f4
Author: Duarte Meneses <[email protected]>
Date: 2017-07-04T15:33:10Z
[MNG-5965] Parallel build multiplies work if multiple goals are given
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]