executeDeploymentPhase(recipeFile, antProps, buildListeners, DeploymentPhase.STOP, null);
File deployDir = request.getAbsoluteDestinationDirectory();
DeploymentsMetadata deployMetadata = new DeploymentsMetadata(deployDir);
DeploymentPhase installPhase = (deployMetadata.isManaged()) ? DeploymentPhase.UPGRADE
: DeploymentPhase.INSTALL;
BundleAntProject project = executeDeploymentPhase(recipeFile, antProps, buildListeners, installPhase,
new PluginContainerHandoverTarget(request));
executeDeploymentPhase(recipeFile, antProps, buildListeners, DeploymentPhase.START, null);
// Send the diffs to the Server so it can store them as an entry in the deployment history.
BundleManagerProvider bundleManagerProvider = request.getBundleManagerProvider();
DeployDifferences diffs = project.getDeployDifferences();
String msg = "Added files=" + diffs.getAddedFiles().size() + "; Deleted files="
+ diffs.getDeletedFiles().size() + " (see attached details for more information)";
String fullDetails = formatDiff(diffs);
bundleManagerProvider.auditDeployment(resourceDeployment, "Deployment Differences", project.getName(),
DEPLOY_STEP, null, msg, fullDetails);
} catch (Throwable t) {
if (LOG.isDebugEnabled()) {
try {
LOG.debug(new String(StreamUtil.slurp(new FileInputStream(logFile))));