protected Exporter configureExporter(Exporter exp) throws MojoExecutionException {
// add output directory to compile roots
getProject().addCompileSourceRoot(new File(getComponent().getOutputDirectory()).getPath());
// now set the extra properties for the POJO Exporter
POJOExporter exporter = (POJOExporter) super.configureExporter(exp);
// Add custom template path if specified
String[] templatePaths;
if (templateDirectory != null) {
templatePaths = new String[exporter.getTemplatePaths().length + 1];
templatePaths[0] = templateDirectory;
if (exporter.getTemplatePaths().length > 1) {
for (int i = 1; i < exporter.getTemplatePaths().length; i++) {
templatePaths[i] = exporter.getTemplatePaths()[i-1];
}
}
} else {
templatePaths = exporter.getTemplatePaths();
}
exporter.setTemplatePath(templatePaths);
exporter.setTemplateName("appfuse/model/Pojo.ftl");
exporter.getProperties().setProperty("basepackage", getProject().getGroupId());
exporter.getProperties().setProperty("ejb3", getComponentProperty("ejb3", "true"));
exporter.getProperties().setProperty("jdk5", getComponentProperty("jdk5", "true"));
if (isFullSource()) {
exporter.getProperties().setProperty("appfusepackage", getProject().getGroupId());
} else {
exporter.getProperties().setProperty("appfusepackage", "org.appfuse");
}
return exporter;
}