use of org.sonatype.aether.resolution.DependencyResolutionException in project zeppelin by apache.
the class DepInterpreter method interpret.
@Override
public InterpreterResult interpret(String st, InterpreterContext context) {
PrintStream printStream = new PrintStream(out);
Console.setOut(printStream);
out.reset();
SparkInterpreter sparkInterpreter = getSparkInterpreter();
if (sparkInterpreter != null && sparkInterpreter.isSparkContextInitialized()) {
return new InterpreterResult(Code.ERROR, "Must be used before SparkInterpreter (%spark) initialized\n" + "Hint: put this paragraph before any Spark code and " + "restart Zeppelin/Interpreter");
}
scala.tools.nsc.interpreter.Results.Result ret = interpret(st);
Code code = getResultCode(ret);
try {
depc.fetch();
} catch (MalformedURLException | DependencyResolutionException | ArtifactResolutionException e) {
LOGGER.error("Exception in DepInterpreter while interpret ", e);
return new InterpreterResult(Code.ERROR, e.toString());
}
if (code == Code.INCOMPLETE) {
return new InterpreterResult(code, "Incomplete expression");
} else if (code == Code.ERROR) {
return new InterpreterResult(code, out.toString());
} else {
return new InterpreterResult(code, out.toString());
}
}
use of org.sonatype.aether.resolution.DependencyResolutionException in project sonatype-aether by sonatype.
the class DefaultRepositorySystem method resolveDependencies.
public DependencyResult resolveDependencies(RepositorySystemSession session, DependencyRequest request) throws DependencyResolutionException {
validateSession(session);
RequestTrace trace = DefaultRequestTrace.newChild(request.getTrace(), request);
DependencyResult result = new DependencyResult(request);
DependencyCollectionException dce = null;
ArtifactResolutionException are = null;
if (request.getRoot() != null) {
result.setRoot(request.getRoot());
} else if (request.getCollectRequest() != null) {
CollectResult collectResult;
try {
request.getCollectRequest().setTrace(trace);
collectResult = dependencyCollector.collectDependencies(session, request.getCollectRequest());
} catch (DependencyCollectionException e) {
dce = e;
collectResult = e.getResult();
}
result.setRoot(collectResult.getRoot());
result.setCollectExceptions(collectResult.getExceptions());
} else {
throw new IllegalArgumentException("dependency node or collect request missing");
}
ArtifactRequestBuilder builder = new ArtifactRequestBuilder(trace);
DependencyFilter filter = request.getFilter();
DependencyVisitor visitor = (filter != null) ? new FilteringDependencyVisitor(builder, filter) : builder;
visitor = new TreeDependencyVisitor(visitor);
result.getRoot().accept(visitor);
List<ArtifactRequest> requests = builder.getRequests();
List<ArtifactResult> results;
try {
results = artifactResolver.resolveArtifacts(session, requests);
} catch (ArtifactResolutionException e) {
are = e;
results = e.getResults();
}
result.setArtifactResults(results);
updateNodesWithResolvedArtifacts(results);
if (dce != null) {
throw new DependencyResolutionException(result, dce);
} else if (are != null) {
throw new DependencyResolutionException(result, are);
}
return result;
}
Aggregations