@Override
  public void generate(File outputFile) throws OutputProjectException {
    LOG.info("Generating: " + outputFile);

    Document pom = FilteredFileUtil.loadExpandedXml(template.getTemplateName(), props);

    if (template.hasDependencies()) {
      Element deps = (Element) pom.selectSingleNode("/project/dependencies");
      if (deps == null) {
        pom.getRootElement().addElement("dependencies");
      }

      for (ProjectDependency pd : template.getDependencies()) {
        ProjectTemplate proj = pd.getProject();
        Element dep = deps.addElement("dependency");
        dep.addElement("groupId").addText(proj.getGroupId());
        dep.addElement("artifactId").addText(proj.getArtifactId());
        dep.addElement("version").addText(proj.getVersion());
      }
    }

    FilteredFileUtil.write(pom, outputFile);
  }