use of org.jboss.galleon.ProvisioningException in project galleon by wildfly.
the class StateIncludePackageCommand method runCommand.
@Override
protected void runCommand(PmCommandInvocation invoc, State session, FeaturePackConfig config) throws IOException, ProvisioningException, CommandExecutionException {
try {
int i = getPackage().indexOf("/");
String name = getPackage().substring(i + 1);
// but no transitive dependency has been created yet.
if (config == null) {
session.includePackageInNewTransitive(invoc.getPmSession(), getProducer(invoc.getPmSession()), name);
} else {
session.includePackage(invoc.getPmSession(), name, config);
}
} catch (Exception ex) {
throw new CommandExecutionException(invoc.getPmSession(), CliErrors.includeFailed(), ex);
}
}
use of org.jboss.galleon.ProvisioningException in project galleon by wildfly.
the class UpdateCommand method doRunCommand.
@Override
protected void doRunCommand(PmCommandInvocation session, Map<String, String> options) throws CommandExecutionException {
try {
ProvisioningManager mgr = getManager(session);
Updates updates = CheckUpdatesCommand.getUpdatesTable(mgr, session, allDependencies(), getFP());
if (updates.plan.isEmpty()) {
session.println(UP_TO_DATE);
} else {
session.println(UPDATES_AVAILABLE);
session.println(updates.t.build());
if (!noConfirm()) {
try {
Key k = null;
while (k == null || (!Key.y.equals(k) && !Key.n.equals(k))) {
session.print("Proceed with latest updates [y/n]?");
KeyAction a = session.input();
k = Key.findStartKey(a.buffer().array());
}
if (Key.n.equals(k)) {
return;
}
} finally {
session.println("");
}
}
mgr.apply(updates.plan, options);
}
} catch (ProvisioningException | IOException ex) {
throw new CommandExecutionException(session.getPmSession(), CliErrors.updateFailed(), ex);
} catch (InterruptedException ignored) {
// Just exit the command smoothly
}
}
use of org.jboss.galleon.ProvisioningException in project galleon by wildfly.
the class AbstractPluginsCommand method runCommand.
@Override
protected void runCommand(PmCommandInvocation session, Map<String, String> options) throws CommandExecutionException {
if (isVerbose()) {
session.getPmSession().enableMavenTrace(true);
}
try {
final String id = getId(pmSession);
final FeaturePackLocation loc = id == null ? null : pmSession.getResolvedLocation(getInstallationDirectory(session.getConfiguration().getAeshContext()), id);
runCommand(session, options, loc);
} catch (ProvisioningException ex) {
throw new CommandExecutionException(session.getPmSession(), CliErrors.resolveLocationFailed(), ex);
} finally {
session.getPmSession().enableMavenTrace(false);
}
}
use of org.jboss.galleon.ProvisioningException in project galleon by wildfly.
the class MavenResolveFeaturePack method runCommand.
@Override
protected void runCommand(PmCommandInvocation session) throws CommandExecutionException {
try {
if (verbose) {
session.getPmSession().enableMavenTrace(true);
}
try {
session.getPmSession().downloadFp(session.getPmSession().getResolvedLocation(null, fpl).getFPID());
session.println("artifact installed in local mvn repository " + session.getPmSession().getPmConfiguration().getMavenConfig().getLocalRepository());
} finally {
session.getPmSession().enableMavenTrace(false);
}
} catch (ProvisioningException ex) {
throw new CommandExecutionException(session.getPmSession(), CliErrors.resolveFeaturePackFailed(), ex);
}
}
use of org.jboss.galleon.ProvisioningException in project galleon by wildfly.
the class StateResetConfigCommand method getConfiguration.
protected ConfigInfo getConfiguration(State state) throws PathParserException, PathConsumerException, ProvisioningException, Exception {
String path = FeatureContainerPathConsumer.FINAL_CONFIGS_PATH + configuration + PathParser.PATH_SEPARATOR;
FeatureContainerPathConsumer consumer = new FeatureContainerPathConsumer(state.getContainer(), false);
PathParser.parse(path, consumer);
ConfigInfo ci = consumer.getConfig();
if (ci == null) {
throw new ProvisioningException("Not a valid config " + configuration);
}
return ci;
}
Aggregations