Class UberJarOperation


public class UberJarOperation extends AbstractOperation<UberJarOperation>
Creates an uberjar archive of the provided jars and resources.
Since:
1.5
  • Constructor Details

    • UberJarOperation

      public UberJarOperation()
  • Method Details

    • execute

      public void execute() throws IOException, FileUtilsErrorException
      Performs the uberjar operation.
      Specified by:
      execute in class AbstractOperation<UberJarOperation>
      Throws:
      IOException - when an exception occurred during the uberjar creation process
      FileUtilsErrorException - when an exception occurred during the uberjar creation process
      Since:
      1.5
    • executeCollectSourceJarContents

      protected void executeCollectSourceJarContents(File stagingDirectory) throws FileUtilsErrorException
      Part of the execute() operation, collect the contents of all the source jars.
      Throws:
      FileUtilsErrorException
      Since:
      1.5
    • executeCollectSourceResources

      protected void executeCollectSourceResources(File stagingDirectory) throws FileUtilsErrorException
      Part of the execute() operation, collect the source resources.
      Throws:
      FileUtilsErrorException
      Since:
      1.5
    • executeCreateUberJarArchive

      protected void executeCreateUberJarArchive(File stagingDirectory) throws IOException
      Part of the execute() operation, create the uberjar archive.
      Throws:
      IOException
      Since:
      1.5
    • fromProject

      public UberJarOperation fromProject(BaseProject project)
      Configures an uberjar operation from a BaseProject.
      Parameters:
      project - the project to configure the uberjar operation from
      Since:
      1.5
    • jarSourceFiles

      public UberJarOperation jarSourceFiles(File... files)
      Provides source jar files that will be used for the uberjar archive creation.
      Parameters:
      files - source files
      Returns:
      this operation instance
      Since:
      1.5.18
    • jarSourceFiles

      public UberJarOperation jarSourceFiles(List<File> files)
      Provides a list of source jar files that will be used for the uberjar archive creation.

      A copy will be created to allow this list to be independently modifiable.

      Parameters:
      files - a list of jar source files
      Returns:
      this operation instance
      Since:
      1.5
    • sourceDirectories

      public UberJarOperation sourceDirectories(NamedFile... directories)
      Provides source directories that will be used for the uberjar archive creation.
      Parameters:
      directories - source directories
      Returns:
      this operation instance
      Since:
      1.5.18
    • sourceDirectories

      public UberJarOperation sourceDirectories(List<NamedFile> directories)
      Provides a list of source directories that will be used for the uberjar archive creation.

      A copy will be created to allow this list to be independently modifiable.

      Parameters:
      directories - a list of source directories
      Returns:
      this operation instance
      Since:
      1.5
    • destinationDirectory

      public UberJarOperation destinationDirectory(File directory)
      Provides the destination directory in which the uberjar archive will be created.
      Parameters:
      directory - the uberjar destination directory
      Returns:
      this operation instance
      Since:
      1.5
    • destinationFileName

      public UberJarOperation destinationFileName(String name)
      Provides the destination file name that will be used for the uberjar archive creation.
      Parameters:
      name - the uberjar archive destination file name
      Returns:
      this operation instance
      Since:
      1.5
    • mainClass

      public UberJarOperation mainClass(String name)
      Provides the main class to run from the uberjar archive.
      Parameters:
      name - the main class to run
      Returns:
      this operation instance
      Since:
      1.5
    • jarSourceFiles

      public List<File> jarSourceFiles()
      Retrieves the list of jar source files that will be used for the uberjar archive creation.

      This is a modifiable list that can be retrieved and changed.

      Returns:
      the uberjar archive's jar source files
      Since:
      1.5
    • sourceDirectories

      public List<NamedFile> sourceDirectories()
      Retrieves the list of source directories that will be used for the uberjar archive creation.

      This is a modifiable list that can be retrieved and changed.

      Returns:
      the uberjar archive's source directories
      Since:
      1.5
    • destinationDirectory

      public File destinationDirectory()
      Retrieves the destination directory in which the uberjar archive will be created.
      Returns:
      the uberjar archive's destination directory
      Since:
      1.5
    • destinationFileName

      public String destinationFileName()
      Retrieves the destination file name that will be used for the uberjar archive creation.
      Returns:
      the uberjar archive's destination file name
      Since:
      1.5
    • mainClass

      public String mainClass()
      Retrieves the main class to run from the uberjar archive.
      Returns:
      the main class to run
      Since:
      1.5