Class JpackageMojo

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

    @Mojo(name="jpackage",
          requiresDependencyResolution=RUNTIME,
          defaultPhase=PACKAGE,
          requiresProject=true)
    public class JpackageMojo
    extends AbstractJlinkMojo
    Mojo to create an application installer package.
    Still WIP. Will be cont'd when Java 13 RC is out.
    • Constructor Detail

      • JpackageMojo

        public JpackageMojo()
    • Method Detail

      • getImageDirectory

        public java.io.File getImageDirectory()
        Gets the directory created by jpackage holding the image.
        Specified by:
        getImageDirectory in class AbstractJlinkMojo
        Returns:
        the image dir, never null
      • prepareExecute

        public void prepareExecute()
                            throws org.apache.maven.plugin.MojoExecutionException,
                                   org.apache.maven.plugin.MojoFailureException
        Overrides:
        prepareExecute in class AbstractJlinkMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException
        org.apache.maven.plugin.MojoFailureException
      • 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
      • createImage

        protected void createImage​(JlinkResolver.Result result)
                            throws org.apache.maven.plugin.MojoExecutionException,
                                   org.apache.maven.plugin.MojoFailureException
        Creates the application image.
        Specified by:
        createImage 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
      • copyArtifacts

        protected void copyArtifacts​(JlinkResolver.Result result)
                              throws org.apache.maven.plugin.MojoExecutionException
        Description copied from class: AbstractJlinkMojo
        Copies artifacts not already in the created jlink image to module- or classpath.
        Overrides:
        copyArtifacts in class AbstractJlinkMojo
        Parameters:
        result - the resolver info
        Throws:
        org.apache.maven.plugin.MojoExecutionException - if copy failed
      • validate

        protected boolean validate()
                            throws org.apache.maven.plugin.MojoExecutionException
        Overrides:
        validate in class AbstractJlinkMojo
        Throws:
        org.apache.maven.plugin.MojoExecutionException