Skip to content

Commit 837db7a

Browse files
Christoph Läubrichmichael-o
authored andcommitted
[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 #1028
1 parent 3d4fee3 commit 837db7a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

maven-core/src/main/java/org/apache/maven/lifecycle/internal/builder/multithreaded/ConcurrencyDependencyGraph.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ public List<MavenProject> getRootSchedulableBuilds() {
6969
result.add(projectBuild.getProject());
7070
}
7171
}
72+
if (result.isEmpty() && projectBuilds.size() > 0) {
73+
// Must return at least one project
74+
result.add(projectBuilds.get(0).getProject());
75+
}
7276
return new ArrayList<>(result);
7377
}
7478

0 commit comments

Comments
 (0)