use of com.twosigma.beakerx.kernel.magic.command.MavenJarResolver.AddMvnCommandResult in project beakerx by twosigma.
the class ClasspathAddMvnMagicCommand method execute.
@Override
public MagicCommandOutcomeItem execute(MagicCommandExecutionParam param) {
String command = param.getCommand();
String[] split = MagicCommandUtils.splitPath(command);
if (!(isGradleFormat(split) || isMavenFormat(split))) {
return new MagicCommandOutput(MagicCommandOutput.Status.ERROR, ADD_MVN_FORMAT_ERROR_MESSAGE);
}
commandParams.setRepos(getRepos().get());
MavenJarResolver classpathAddMvnCommand = new MavenJarResolver(commandParams, pomFactory);
MvnLoggerWidget progress = new MvnLoggerWidget(param.getCode().getMessage());
AddMvnCommandResult result = retrieve(getDependency(split), classpathAddMvnCommand, progress);
if (result.isJarRetrieved()) {
return handleAddedJars(classpathAddMvnCommand.getPathToMavenRepo() + "/*");
}
return new MagicCommandOutput(MagicCommandOutput.Status.ERROR, result.getErrorMessage());
}
Aggregations