code: protected Resource<?> generateNavigation(final String targetDir)
              throws IOException
     {
        WebResourcesFacet web = this.project.getFacet(WebResourcesFacet.class);
        HtmlTag unorderedList = new HtmlTag("ul");
  
        ResourceFilter filter = new ResourceFilter()
        {
           @Override
           public boolean accept(Resource<?> resource)
           {
              FileResource<?> file = (FileResource<?>) resource;
  
              if (!file.isDirectory()
                       || file.getName().equals("resources")
                       || file.getName().equals("WEB-INF")
                       || file.getName().equals("META-INF"))
              {
                 return false;
              }
  
              return true;
           }
        };
  
        for (Resource<?> resource : web.getWebResource(targetDir + "/").listResources(filter))
        {
           HtmlOutcomeTargetLink outcomeTargetLink = new HtmlOutcomeTargetLink();
           String outcome = targetDir.isEmpty() || targetDir.startsWith("/") ? targetDir : "/" + targetDir;
           outcomeTargetLink.putAttribute("outcome", outcome + "/" + resource.getName() + "/search");
           outcomeTargetLink.setValue(StringUtils.uncamelCase(resource.getName()));
  
           HtmlTag listItem = new HtmlTag("li");
           listItem.getChildren().add(outcomeTargetLink);
           unorderedList.getChildren().add(listItem);
        }
  
        Writer writer = new IndentedWriter(new StringWriter(), this.navigationTemplateIndent);
        unorderedList.write(writer);
  
        Map<Object, Object> context = CollectionUtils.newHashMap();
        context.put("appName", StringUtils.uncamelCase(this.project.getRoot().getName()));
        context.put("navigation", writer.toString().trim());
        context.put("targetDir", targetDir);
  
        if (this.navigationTemplate == null)
        {
           loadTemplates();
        }
  
        try
        {
           return ScaffoldUtil.createOrOverwrite((FileResource<?>) getTemplateStrategy()
                    .getDefaultTemplate(),
                    FreemarkerTemplateProcessor.processTemplate(context, navigationTemplate));
        }
        finally
        {
           writer.close();
        }
     }
docs: Generates the navigation menu based on scaffolded entities.