mirror of https://github.com/apache/maven.git
[MNG-7716] ConcurrencyDependencyGraph deadlock if no root is selected
If ConcurrencyDependencyGraph#getRootSchedulableBuilds returns an empty list then MultiThreadedBuilder is locked forever as it never gets a build result (because nothing is scheduled). This changes the method, that in such case just the first project is returned, this might not give the best performance, but ensures that there is at least one build scheduled and the build-loop can proceed. This closes #1029
This commit is contained in:
parent
65d95f08a6
commit
f41d533e71
|
@ -69,6 +69,10 @@ public class ConcurrencyDependencyGraph {
|
|||
result.add(projectBuild.getProject());
|
||||
}
|
||||
}
|
||||
if (result.isEmpty() && projectBuilds.size() > 0) {
|
||||
// Must return at least one project
|
||||
result.add(projectBuilds.get(0).getProject());
|
||||
}
|
||||
return new ArrayList<>(result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue