final DeploymentPlan plan = createPlan(builder);
if (plan.getDeploymentActions().size() > 0) {
final ServerDeploymentPlanResult planResult = manager.execute(plan).get();
// Check the results
for (DeploymentAction action : plan.getDeploymentActions()) {
final ServerDeploymentActionResult actionResult = planResult.getDeploymentActionResult(action.getId());
final ServerUpdateActionResult.Result result = actionResult.getResult();
switch (result) {
case FAILED:
throw new MojoExecutionException("Deployment failed.", actionResult.getDeploymentException());
case NOT_EXECUTED:
throw new MojoExecutionException("Deployment not executed.", actionResult.getDeploymentException());
case ROLLED_BACK:
throw new MojoExecutionException("Deployment failed and was rolled back.", actionResult.getDeploymentException());
case CONFIGURATION_MODIFIED_REQUIRES_RESTART:
getLog().warn("Action was executed, but the server requires a restart.");
break;
default:
break;