private void runGeneration(String thisSourceRoot,
VelocityEngine engine,
File thisOutputDirectory,
File thisDoNotReplaceDirectory, String[] excludes) throws MojoExecutionException {
FileSet fileSet = new FileSet();
fileSet.setDirectory(thisSourceRoot);
List<String> includes = new ArrayList<String>();
includes.add("**/*.java.t");
fileSet.setIncludes(includes);
String[] includedFiles = fileSetManager.getIncludedFiles(fileSet);
for (String template : includedFiles) {
File templateFile = new File(thisSourceRoot, template);
String subpath = templateFile.getParentFile().getPath().substring(
fileSet.getDirectory().length());
thisOutputDirectory.mkdirs();
File thisDoNotReplaceFull = new File(thisDoNotReplaceDirectory, subpath);
processOneTemplate(engine, template, thisOutputDirectory,
thisDoNotReplaceFull, subpath.substring(1), excludes);
}