Class UpdateModules

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
    Direct Known Subclasses:
    JlinkMojo, PackageMojo

    public abstract class UpdateModules
    extends org.apache.maven.plugin.AbstractMojo
    Interface to update the jar as modules. Generates the module-info.java for the jar.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int EXTENSION_LENGTH
      The length of an extension.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        UpdateModules()
      The standard constructor.
      protected UpdateModules​(boolean pOpenmodule, boolean pCreatemissing)
      The constructor for tests.
    • Field Detail

      • EXTENSION_LENGTH

        public static final int EXTENSION_LENGTH
        The length of an extension.
        See Also:
        Constant Field Values
    • Constructor Detail

      • UpdateModules

        public UpdateModules()
        The standard constructor.
      • UpdateModules

        protected UpdateModules​(boolean pOpenmodule,
                                boolean pCreatemissing)
        The constructor for tests.
        Parameters:
        pOpenmodule - use as openmodule.
        pCreatemissing - create the missing classes in the missing module.
    • Method Detail

      • callInDir

        protected CallResult callInDir​(Path dir,
                                       String... param)
                                throws org.apache.maven.plugin.MojoExecutionException
        Calls a command in the dir.
        Parameters:
        dir - the working dir of the call.
        param - the list of parameters.
        Returns:
        lines returned.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - thrown, when an error occurs.
      • zipDir

        protected Path zipDir​(Path dir,
                              Path targetPath,
                              String subName)
                       throws org.apache.maven.plugin.MojoExecutionException
        Creates a zip of the dir.
        Parameters:
        dir - the dir to zip.
        targetPath - the targetPath.
        subName - the sub name.
        Returns:
        the used zipPath.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - thrown if an error occurs.
      • createModules

        protected Path createModules​(org.apache.maven.project.MavenProject project)
                              throws org.apache.maven.plugin.MojoExecutionException
        Creates a copy of the jar of the dependencies to test and update the modules.
        Parameters:
        project - the maven project.
        Returns:
        return the path of the modules dir.
        Throws:
        org.apache.maven.plugin.MojoExecutionException - is thrown if an IOException is thrown.