use of java.rmi.RemoteException in project intellij-community by JetBrains.
the class Maven3ServerEmbedderImpl method resolveTransitively.
@NotNull
@Override
public List<MavenArtifact> resolveTransitively(@NotNull List<MavenArtifactInfo> artifacts, @NotNull List<MavenRemoteRepository> remoteRepositories) throws RemoteException, MavenServerProcessCanceledException {
try {
Set<Artifact> toResolve = new LinkedHashSet<Artifact>();
for (MavenArtifactInfo each : artifacts) {
toResolve.add(createArtifact(each));
}
Artifact project = getComponent(ArtifactFactory.class).createBuildArtifact("temp", "temp", "666", "pom");
Set<Artifact> res = getComponent(ArtifactResolver.class).resolveTransitively(toResolve, project, Collections.EMPTY_MAP, myLocalRepository, convertRepositories(remoteRepositories), getComponent(ArtifactMetadataSource.class)).getArtifacts();
return MavenModelConverter.convertArtifacts(res, new THashMap<Artifact, MavenArtifact>(), getLocalRepositoryFile());
} catch (ArtifactResolutionException e) {
Maven3ServerGlobals.getLogger().info(e);
} catch (ArtifactNotFoundException e) {
Maven3ServerGlobals.getLogger().info(e);
} catch (Exception e) {
throw rethrowException(e);
}
return Collections.emptyList();
}
use of java.rmi.RemoteException 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 java.rmi.RemoteException in project intellij-community by JetBrains.
the class Maven3ServerEmbedderImpl method readModel.
@Override
@Nullable
public MavenModel readModel(File file) throws RemoteException {
Map<String, Object> inputOptions = new HashMap<String, Object>();
inputOptions.put(ModelProcessor.SOURCE, new FileModelSource(file));
ModelReader reader = null;
if (!StringUtil.endsWithIgnoreCase(file.getName(), "xml")) {
try {
Object polyglotManager = myContainer.lookup("org.sonatype.maven.polyglot.PolyglotModelManager");
if (polyglotManager != null) {
Method getReaderFor = ReflectionUtil.getMethod(polyglotManager.getClass(), "getReaderFor", Map.class);
if (getReaderFor != null) {
reader = (ModelReader) getReaderFor.invoke(polyglotManager, inputOptions);
}
}
} catch (ComponentLookupException ignore) {
} catch (Throwable e) {
Maven3ServerGlobals.getLogger().warn(e);
}
}
if (reader == null) {
try {
reader = myContainer.lookup(ModelReader.class);
} catch (ComponentLookupException ignore) {
}
}
if (reader != null) {
try {
Model model = reader.read(file, inputOptions);
return MavenModelConverter.convertModel(model, null);
} catch (Exception e) {
Maven3ServerGlobals.getLogger().warn(e);
}
}
return null;
}
use of java.rmi.RemoteException in project intellij-community by JetBrains.
the class Maven2ServerImpl method createIndexer.
public MavenServerIndexer createIndexer() throws RemoteException {
try {
Maven2ServerIndexerImpl result = new Maven2ServerIndexerImpl();
UnicastRemoteObject.exportObject(result, 0);
return result;
} catch (RemoteException e) {
throw rethrowException(e);
}
}
use of java.rmi.RemoteException in project intellij-community by JetBrains.
the class Maven2ServerImpl method createEmbedder.
public MavenServerEmbedder createEmbedder(MavenEmbedderSettings settings) throws RemoteException {
try {
Maven2ServerEmbedderImpl result = Maven2ServerEmbedderImpl.create(settings.getSettings());
UnicastRemoteObject.exportObject(result, 0);
return result;
} catch (RemoteException e) {
throw rethrowException(e);
}
}
Aggregations