Class ApplicationBuilder

All Implemented Interfaces:
Generator, Renamable, ResourceProvider

The ApplicationBuilder generates resources of type ApplicationZipFile or ApplicationTarFile.

Both resource types are runnable application distributions built from a set of classpath resources and a generated start script that launches the application.

The application can be configured using methods that control:

  • the output directory for the generated distribution,
  • the base name of the generated archive file,
  • the executable (start script) name,
  • the main class to execute (mandatory),
  • and the JVM options required by the application and included in the generated start script.

Method add(Stream) is used to specify the classpath resources to be included in the generated distribution and to be added to the classpath when running the application.

A request for Cleanliness removes any generated distribution archives from the configured destination directory.

The ApplicationBuilder avoids duplicate libraries in the distribution by deduplicating JarFiles based on their file path. If the same jar file is added multiple times, only one copy will be included in the generated distribution.