in maven2-server-impl/src/org/jetbrains/idea/maven/server/embedder/Maven2ServerEmbedderImpl.java [544:570]
private <T> T doExecute(final Executor<T> executor) throws MavenServerProcessCanceledException, RemoteException {
Future<T> future = ExecutorManager.execute(() -> executor.execute());
MavenServerProgressIndicator indicator = myCurrentIndicator;
while (true) {
if (indicator.isCanceled()) throw new MavenServerProcessCanceledException();
try {
return future.get(50, TimeUnit.MILLISECONDS);
}
catch (TimeoutException ignore) {
}
catch (ExecutionException e) {
Throwable cause = e.getCause();
if (cause instanceof MavenProcessCanceledRuntimeException) {
throw new MavenServerProcessCanceledException();
}
if (cause instanceof RuntimeRemoteException) {
throw ((RuntimeRemoteException)cause).getCause();
}
throw getRethrowable(cause);
}
catch (InterruptedException e) {
throw new MavenServerProcessCanceledException();
}
}
}