Interface ModularizeDependenciesTask

All Superinterfaces:
Task<Set<Dependency>,ModularizeDependenciesTask>

public interface ModularizeDependenciesTask extends Task<Set<Dependency>,ModularizeDependenciesTask>

A task for modularizing the dependencies of the project.

A project can have different kind of module dependencies:

  • Modules which define module descriptor.
  • Automatic modules which define the Automatic-Module-Name entry in their MANIFEST.MF and are then named modules.
  • Unnamed modules which unlike the others can't hardly be used as-is in a fully modular application.

The purpose of the modularize dependencies task is to repackage each automatic and unnamed dependency with a proper module descriptor (i.e. module-info.java) in order to be able to package the project in a Jmod, create an optimized runtime and native application delivrable.

After modularization, the module of an unnamed module dependency is named as [GROUP].[NAME] with [NAME] being escaped to be a valid Java identifier (i.e. "-" replaced by "."...).

Module descriptors are generated for automatic and unnamed modules, they can be extended by merging ModuleInfo instances provided with moduleOverrides(java.util.List). Complete module descriptors can also be provided with moduleOverridesPath(java.nio.file.Path) in which case descriptor generation shall be skipped.

Since:
1.4
Author:
Jeremy Kuhn
  • Method Details

    • moduleOverridesPath

      ModularizeDependenciesTask moduleOverridesPath(Path moduleOverridesPath)

      Specifies the path where to find module descritors to use for automatic and unnamed module dependencies instead of trying to generate them.

      Each overridden module-info.java descriptor must be placed in a folder named after the module at the root of the specified path.

      Parameters:
      moduleOverridesPath - the path to the module descriptors
      Returns:
      the task
    • moduleOverrides

      ModularizeDependenciesTask moduleOverrides(List<? extends ModuleInfo> moduleOverrides)

      Specifies a list of module info to extend the module descriptor generated for automatic and unnamed module dependencies.

      The specified module info will be merged into the generated module descriptor for each

      Parameters:
      moduleOverrides - a list of module info
      Returns:
      the task
    • start

      StartTask start()

      Creates a start task.

      Returns:
      a start task
    • start

      default StartTask start(Consumer<StartTask> configurer)

      Creates and configures a start task.

      Parameters:
      configurer - a configurer
      Returns:
      a configured start task
    • run

      RunTask run()

      Creates a run task.

      Returns:
      a run task
    • run

      default RunTask run(Consumer<RunTask> configurer)

      Creates and configures a run task.

      Parameters:
      configurer - a configurer
      Returns:
      a configured run task
    • debug

      DebugTask debug()

      Creates a debug task.

      Returns:
      a debug task
    • debug

      default DebugTask debug(Consumer<DebugTask> configurer)

      Creates and configures a debug task.

      Parameters:
      configurer - a configurer
      Returns:
      a configured debug task
    • buildJmod

      BuildJmodTask buildJmod()

      Creates a jmod build task.

      Returns:
      a jmod build task
    • buildJmod

      default BuildJmodTask buildJmod(Consumer<BuildJmodTask> configurer)

      Creates and configures a jmod build task.

      Parameters:
      configurer - a configurer
      Returns:
      a configured jmod build task