use of org.jetbrains.maven.embedder.MavenExecutionResult in project intellij-community by JetBrains.
the class Maven2ServerEmbedderImpl method resolveProject.
@NotNull
public Collection<MavenServerExecutionResult> resolveProject(@NotNull final Collection<File> files, @NotNull final Collection<String> activeProfiles, @NotNull final Collection<String> inactiveProfiles) throws MavenServerProcessCanceledException, RemoteException {
return ContainerUtil.mapNotNull(files, new Function<File, MavenServerExecutionResult>() {
@Override
public MavenServerExecutionResult fun(final File file) {
try {
return doExecute(new Executor<MavenServerExecutionResult>() {
public MavenServerExecutionResult execute() throws Exception {
DependencyTreeResolutionListener listener = new DependencyTreeResolutionListener(myConsoleWrapper);
MavenExecutionResult result = myImpl.resolveProject(file, new ArrayList<String>(activeProfiles), new ArrayList<String>(inactiveProfiles), Collections.<ResolutionListener>singletonList(listener));
return createExecutionResult(file, result, listener.getRootNode());
}
});
} catch (MavenServerProcessCanceledException e) {
ExceptionUtil.rethrowAllAsUnchecked(e);
} catch (RemoteException e) {
ExceptionUtil.rethrowAllAsUnchecked(e);
}
return null;
}
});
}
Aggregations