Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8191945

Add ToolProvider support for Java Packager

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P2
    • Resolution: Approved
    • Fix Version/s: 10
    • Component/s: deploy
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Minimal risk, it won't affect existing functionality.
    • Interface Kind:
      Java API
    • Scope:
      JDK

      Description

      Summary

      Add ToolProvider support for Java Packager.

      Problem

      Currently, in order to use Java Packager from the code users need to import some packages (like com.oracle.tools.packager.*) and use it via non-standard API. We can simplify it by adding a ToolProvider support.

      Solution

      Introduce the ToolProvider support. Add a new class in jdk.packager.internal.Main(JavaPackagerToolProvider) that implements java.util.spi.ToolProvider. Add "provides java.util.spi.ToolProvider with ..." in module-info.java for jdk.packager module.

      Specification

      The changes for jdk.packager module \ module-info.java:

      provides java.util.spi.ToolProvider with jdk.packager.internal.Main.JavaPackagerToolProvider;

      The following definition will be added in the module-info.java for jdk.packager:

      /**
       * Defines the Java packager tool, javapackager.
       * The javapackager is a tool for generating bundles for self-contained applications.
       * It can be located under the name {@code "javapackager"} using the {@link ToolProvider}, for example:
       * <pre>{@code
       * ToolProvider javaPackager = ToolProvider.findFirst("javapackager").orElseThrow(...);
       * javaPackager.run(...);
       * }</pre>
       */

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vdrozdov Victor Drozdov (Inactive)
                Reporter:
                vdrozdov Victor Drozdov (Inactive)
                Reviewed By:
                Alan Bateman, Alexander Matveev, Kevin Rushforth
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: