Search in sources :

Example 36 with CommandExecutionException

use of org.jboss.galleon.cli.CommandExecutionException 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);
    }
}
Also used : ProvisioningException(org.jboss.galleon.ProvisioningException) FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation) CommandExecutionException(org.jboss.galleon.cli.CommandExecutionException)

Example 37 with CommandExecutionException

use of org.jboss.galleon.cli.CommandExecutionException 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);
    }
}
Also used : ProvisioningException(org.jboss.galleon.ProvisioningException) CommandExecutionException(org.jboss.galleon.cli.CommandExecutionException)

Aggregations

CommandExecutionException (org.jboss.galleon.cli.CommandExecutionException)37 ProvisioningException (org.jboss.galleon.ProvisioningException)25 IOException (java.io.IOException)18 Path (java.nio.file.Path)11 ProvisioningManager (org.jboss.galleon.ProvisioningManager)8 FeaturePackLocation (org.jboss.galleon.universe.FeaturePackLocation)7 FeatureContainer (org.jboss.galleon.cli.model.FeatureContainer)6 ProvisioningConfig (org.jboss.galleon.config.ProvisioningConfig)6 State (org.jboss.galleon.cli.model.state.State)5 FeaturePackLayout (org.jboss.galleon.layout.FeaturePackLayout)5 FeaturePackConfig (org.jboss.galleon.config.FeaturePackConfig)4 ArrayList (java.util.ArrayList)3 Group (org.jboss.galleon.cli.model.Group)3 FeatureContainerPathConsumer (org.jboss.galleon.cli.path.FeatureContainerPathConsumer)3 PathConsumerException (org.jboss.galleon.cli.path.PathConsumerException)3 PathParserException (org.jboss.galleon.cli.path.PathParserException)3 FPID (org.jboss.galleon.universe.FeaturePackLocation.FPID)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 OutputStreamWriter (java.io.OutputStreamWriter)2 PrintWriter (java.io.PrintWriter)2