DeploymentManager dmgr = connection.getDeploymentManager();
if(dmgr instanceof GeronimoDeploymentManager) {
GeronimoDeploymentManager mgr = (GeronimoDeploymentManager) dmgr;
try {
mgr.eraseUninstall(bundleId);
consoleReader.printString(DeployUtils.reformat("Uninstalled and erased bundle: " + bundleId, 4, 72));
} catch (Exception e) {
throw new DeploymentException("Unable to erase bundle: " + bundleId, e);
}