configure(config);
return containerFactory.createContainer(id, ContainerType.REMOTE, config);
}
protected void deploy(DeployerFactory deployerFactory, final BuildListener listener, Container container, File f, String contextPath) {
Deployer deployer = deployerFactory.createDeployer(container);
listener.getLogger().println("Deploying " + f + " to container " + container.getName());
deployer.setLogger(new LoggerImpl(listener.getLogger()));
String extension = FilenameUtils.getExtension(f.getAbsolutePath());
if ("WAR".equalsIgnoreCase(extension)) {
WAR war = createWAR(f);
if (!StringUtils.isEmpty(contextPath)) {
war.setContext(contextPath);
}
deployer.redeploy(war);
} else if ("EAR".equalsIgnoreCase(extension)) {
EAR ear = createEAR(f);
deployer.redeploy(ear);
} else {
throw new RuntimeException("Extension File Error.");
}
}