public synchronized void addWarDeployment(String archiveName, boolean show, Package... pkgs) {
deployments.add(new WarDeployment(archiveName, pkgs, show));
}
public synchronized void deploy() throws DuplicateDeploymentNameException, IOException, ExecutionException, InterruptedException, TimeoutException {
DeploymentPlanBuilder builder = manager.newDeploymentPlan();
for (AbstractDeployment deployment : deployments) {
builder = deployment.addDeployment(manager, builder);
}
try {
manager.execute(builder.build()).get(timeout, TimeUnit.MILLISECONDS);
} finally {
markDeploymentsDeployed();
}
}