file.getParentFile().mkdirs();
getLog().info("Generating source file " + file.getAbsolutePath() + "...");
VelocityEngine engine = createVelocityEngine();
final Template template = engine.getTemplate(templateName);
final FileWriter fw = new FileWriter(file);
template.merge(context, fw);
fw.close();
}
catch( Exception e )
{
throw new MojoExecutionException("Unable to generate source file for class " + className + ".", e);