final File destFile = new File("target/" + contextName + ".war");
try {
FileUtils.copyFile(srcFile, destFile);
} catch (final IOException e) {
throw new DeployException("Failed to copy WAR file: " + path, e);
}
path = destFile.getPath();
}
} else {
deployableType = determineDeployableType(type);
}
/*
* Add the deployable
*/
addDeployable(configuration, path, deployableType);
}
// create installedLocalContainer
installedLocalContainer = (InstalledLocalContainer) new DefaultContainerFactory().createContainer("glassfish2",
ContainerType.INSTALLED, configuration);
// configure installedLocalContainer
installedLocalContainer.setHome(containerHome);
final Logger fileLogger = new FileLogger(new File(cargoLogFilePath + "cargo.log"), true);
fileLogger.setLevel(LogLevel.DEBUG);
installedLocalContainer.setLogger(fileLogger);
installedLocalContainer.setOutput(cargoLogFilePath + "output.log");
// set the system properties
installedLocalContainer.setSystemProperties(systemProperties);
try {
completeGlassfishConfiguration();
} catch (final IOException e) {
throw new DeployException("Failed to complete the Glassfish configuration while setting the env files", e);
}
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Starting Glassfish [" + configurationName + "]...");
}