Class AbstractTemplateToolMojo

java.lang.Object
org.apache.maven.plugin.AbstractMojo
net.agilhard.maven.plugins.jpacktool.base.mojo.AbstractToolMojo
net.agilhard.maven.plugins.jpacktool.base.mojo.AbstractTemplateToolMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
AbstractPackageToolMojo

public abstract class AbstractTemplateToolMojo
extends AbstractToolMojo
Base class for Mojos operating with templates.

The Freemarker Java Template Engine is used for the templates.

Author:
Bernd Eilers
  • Field Details

  • Constructor Details

  • Method Details

    • initTemplates

      protected void initTemplates() throws org.apache.maven.plugin.MojoFailureException
      Initialize Templates copy them from resource: URLs to the filesystem.

      Can be implemented in derived classes the base class method does nothing.

      Throws:
      org.apache.maven.plugin.MojoFailureException - on plugin failure
    • loadResourceFileIntoString

      protected java.lang.String loadResourceFileIntoString​(java.lang.String path) throws org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoFailureException
    • initTemplate

      protected java.lang.String initTemplate​(java.lang.String res, java.lang.String template) throws org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoFailureException
    • getTemplateMap

      protected java.util.Map<java.lang.String,​java.lang.Object> getTemplateMap()
    • generateFromTemplate

      protected void generateFromTemplate​(java.lang.String templateName, java.io.File outputFile) throws org.apache.maven.plugin.MojoFailureException
      Throws:
      org.apache.maven.plugin.MojoFailureException
    • getTemplateGenerator

      public AbstractTemplateToolMojo.TemplateGenerator getTemplateGenerator()