Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import java.util.concurrent.ExecutorCompletionService;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

import org.apache.maven.execution.MavenSession;
import org.apache.maven.lifecycle.internal.BuildThreadFactory;
Expand Down Expand Up @@ -114,6 +114,9 @@ public void build( MavenSession session, ReactorContext reactorContext, ProjectB
}

}

executor.shutdown();
executor.awaitTermination( Long.MAX_VALUE, TimeUnit.MILLISECONDS );
}

private void multiThreadedProjectTaskSegmentBuild( ConcurrencyDependencyGraph analyzer,
Expand Down Expand Up @@ -172,21 +175,6 @@ private void multiThreadedProjectTaskSegmentBuild( ConcurrencyDependencyGraph an
break;
}
}

// cancel outstanding builds (if any) - this can happen if an exception is thrown in above block

Future<ProjectSegment> unprocessed;
while ( ( unprocessed = service.poll() ) != null )
{
try
{
unprocessed.get();
}
catch ( InterruptedException | ExecutionException e )
{
throw new RuntimeException( e );
}
}
}

private Callable<ProjectSegment> createBuildCallable( final MavenSession rootSession,
Expand Down