public void uninstallBundle(Deployment dep) {
log.tracef("Uninstall deployment: %s", dep);
// Always uninstall from the bundle manager
BundleManagement bundleManager = injectedBundleManager.getValue();
bundleManager.uninstallBundle(dep);
try {
// Undeploy through the deployment manager
DeploymentPlanBuilder builder = deploymentManager.newDeploymentPlan();
String contextName = DeploymentHolderService.getContextName(dep);