throw new IllegalStateException("No target to distribute to");
}
targets = new Target[] {targets[0]};
ProgressObject progress = manager.distribute(targets, file, plan);
DeploymentStatus status = waitFor(progress);
if (status.isFailed()) {
//
// FIXME: There must be a better way to handle this.
//
if (status.getMessage().indexOf("already exists") < 0 ) {
throw new MojoExecutionException("Distribution failed: " + status.getMessage());
}
log.info("Module already exists");
}