Class InitMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="init",
          inheritByDefault=false,
          aggregator=true)
    public class InitMojo
    extends AbstractJLinkMojo
    Initializes the templates.
    Copies the default templates to the project's template directory.
    • Constructor Detail

      • InitMojo

        public InitMojo()
    • Method Detail

      • executeImpl

        public void executeImpl()
                         throws org.apache.maven.plugin.MojoExecutionException,
                                org.apache.maven.plugin.MojoFailureException
        Overrides:
        executeImpl in class AbstractJLinkMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • installTemplates

        protected void installTemplates​(boolean overwrite)
                                 throws org.apache.maven.plugin.MojoExecutionException
        Description copied from class: AbstractJLinkMojo
        Copies the templates to the template directory.
        Specified by:
        installTemplates in class AbstractJLinkMojo
        Parameters:
        overwrite - true if overwrite existing templates, false if install only missing
        Throws:
        org.apache.maven.plugin.MojoExecutionException - if installation failed
      • createJLinkImage

        protected void createJLinkImage​(JLinkResolver.Result result)
                                 throws org.apache.maven.plugin.MojoExecutionException,
                                        org.apache.maven.plugin.MojoFailureException
        Description copied from class: AbstractJLinkMojo
        Creates the jlink image.
        Overrides:
        createJLinkImage in class AbstractJLinkMojo
        Parameters:
        result - the resolver info
        Throws:
        org.apache.maven.plugin.MojoExecutionException - if building the JPMS info failed
        org.apache.maven.plugin.MojoFailureException - if jlink returned an error code
      • generateFiles

        protected void generateFiles​(JLinkResolver.Result result)
                              throws org.apache.maven.plugin.MojoExecutionException
        Description copied from class: AbstractJLinkMojo
        Generates additional files such as shell scripts or command files.
        Specified by:
        generateFiles in class AbstractJLinkMojo
        Parameters:
        result - the resolver result
        Throws:
        org.apache.maven.plugin.MojoExecutionException - if generation failed