if (!appYamlFile.isFile()) {
throw new IllegalArgumentException(appYamlFile.getPath() + " not found.");
}
File destination = (generatedWarDir == null ? null : new File(generatedWarDir));
try {
WarGenerator warGen =
WarGeneratorFactory.newWarGenerator(externalResourceDirectory, destination);
String warDir = warGen.generateWarDirectory().getPath();
System.out.println("Successfully generated war directory at " + warDir);
return warDir;
} catch (IOException e) {
throw new RuntimeException("Unable to generate a war directory.", e);
}