Interface TemplateModelFactory

All Known Implementing Classes:
DefaultTemplateModelFactory

public interface TemplateModelFactory
Factory for the freemarker template model.

May be replaced via @Service annotation from within an application-specific plugin dependency. For example, to add template variables from other sources.

Example:

   @Service(TemplateModelFactory.class)
   public class SpecialTemplateModelFactory implements TemplateModelFactory {

     @Override
     public TemplateModel create(AbstractJlinkMojo mojo, JlinkResolver.Result result) throws MojoExecutionException {
       ...
     }
   }
 
Add as plugin dependency:
   <plugin>
     <groupId>org.tentackle</groupId>
     <artifactId>tentackle-jlink-maven-plugin</artifactId>
     <dependencies>
       <dependency>
         <groupId>com.example</groupId>
         <artifactId>special-creator</artifactId>
         <version>1.0</version>
       </dependency>
     </dependencies>
     <configuration>
       ...
     </configuration>
   </plugin>
 
  • Method Details

    • getInstance

      static TemplateModelFactory getInstance()
      The singleton.
      Returns:
      the singleton
    • create

      TemplateModel create(AbstractJLinkMojo mojo, JLinkResolver.Result result) throws org.apache.maven.plugin.MojoExecutionException
      Creates the template model.
      Parameters:
      mojo - the mojo
      result - the resolver result
      Returns:
      the model
      Throws:
      org.apache.maven.plugin.MojoExecutionException - if model creation failed