public String deploy(Archive<?> archive, String target) throws DeploymentException { try { final InputStream input = archive.as(ZipExporter.class).exportAsInputStream(); try { InitialDeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan(); DeploymentPlan plan = builder.add(archive.getName(), input).andDeploy().toServerGroup(target).build(); DeploymentAction deployAction = plan.getDeploymentActions().get(plan.getDeploymentActions().size() - 1); return executeDeploymentPlan(plan, deployAction); } finally { if (input != null) try { input.close(); } catch (IOException e) { log.warnf(e, "Failed to close resource %s", input); } } } catch (Exception e) { throw new DeploymentException("Could not deploy to container", e); } }
InitialDeploymentSetBuilder builder = deploymentManagerDeprecated.newDeploymentPlan().withRollbackAcrossGroups(); final DeployDeploymentPlanBuilder deployBuilder = builder.add(archive.getName(), input).andDeploy(); ServerGroupDeploymentPlanBuilder serverGroupBuilder = null;