use of org.apache.maven.shared.dependency.tree.DependencyTreeResolutionListener in project intellij-community by JetBrains.
the class Maven30ServerEmbedderImpl method resolveProject.
@NotNull
@Override
public Collection<MavenServerExecutionResult> resolveProject(@NotNull final Collection<File> files, @NotNull Collection<String> activeProfiles, @NotNull Collection<String> inactiveProfiles) throws RemoteException, MavenServerProcessCanceledException {
final DependencyTreeResolutionListener listener = new DependencyTreeResolutionListener(myConsoleWrapper);
Collection<MavenExecutionResult> results = doResolveProject(files, new ArrayList<String>(activeProfiles), new ArrayList<String>(inactiveProfiles), Collections.<ResolutionListener>singletonList(listener));
return ContainerUtil.mapNotNull(results, new Function<MavenExecutionResult, MavenServerExecutionResult>() {
@Override
public MavenServerExecutionResult fun(MavenExecutionResult result) {
try {
return createExecutionResult(result.getPomFile(), result, listener.getRootNode());
} catch (RemoteException e) {
ExceptionUtil.rethrowAllAsUnchecked(e);
}
return null;
}
});
}
use of org.apache.maven.shared.dependency.tree.DependencyTreeResolutionListener in project intellij-community by JetBrains.
the class Maven3ServerEmbedderImpl method resolveProject.
@NotNull
@Override
public Collection<MavenServerExecutionResult> resolveProject(@NotNull Collection<File> files, @NotNull Collection<String> activeProfiles, @NotNull Collection<String> inactiveProfiles) throws RemoteException, MavenServerProcessCanceledException {
final DependencyTreeResolutionListener listener = new DependencyTreeResolutionListener(myConsoleWrapper);
Collection<MavenExecutionResult> results = doResolveProject(files, new ArrayList<String>(activeProfiles), new ArrayList<String>(inactiveProfiles), Collections.<ResolutionListener>singletonList(listener));
return ContainerUtil.mapNotNull(results, new Function<MavenExecutionResult, MavenServerExecutionResult>() {
@Override
public MavenServerExecutionResult fun(MavenExecutionResult result) {
try {
return createExecutionResult(result.getPomFile(), result, listener.getRootNode());
} catch (RemoteException e) {
ExceptionUtil.rethrowAllAsUnchecked(e);
}
return null;
}
});
}
use of org.apache.maven.shared.dependency.tree.DependencyTreeResolutionListener in project che by eclipse.
the class MavenServerImpl method resolveProject.
@Override
public MavenServerResult resolveProject(File pom, List<String> activeProfiles, List<String> inactiveProfiles) throws RemoteException {
DependencyTreeResolutionListener listener = new DependencyTreeResolutionListener(terminalLogger);
MavenResult mavenResult = internalResolveProject(pom, activeProfiles, inactiveProfiles, Collections.singletonList(listener));
return createResult(pom, mavenResult);
}
use of org.apache.maven.shared.dependency.tree.DependencyTreeResolutionListener 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