log.info("Distributing module artifact: " + file + " with plan " + plan);
DeploymentManager manager = getDeploymentManager();
Target[] targets = manager.getTargets();
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");
}