JDK-8222782 : jpackage: evaluate use of jlink --bind-services for modular apps
  • Type: Enhancement
  • Component: tools
  • Sub-Component: jpackage
  • Affected Version: internal
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2019-04-19
  • Updated: 2019-11-12
  • Resolved: 2019-11-12
Related Reports
Duplicate :  
Relates :  
Description
This is from an email exchange during the review of the JEP.

Mandy's comments start with ">"

> 2. Under "Modular application" section:
>
>    "When creating an application image from a modular application, jpackage will run jlink with a default set of arguments, using the provided module as the root module with all service providers added, to produce the Java runtime image that will be used to run the application. "
>
> "default set of arguments" is not clear what it means.  Does it run `--bind-services` by default?   it'd be help to make it clear for example "jpackage will run jlink with the main module and additional modules specified in `--add-modules` option as the root module with service binding."?

Yes, it does run '--bind-services' by default (as in the non-modular application case). It is a good question as to whether it should do this for modular apps (see below).

> Is service binding the default for packaging modular application?   I wonder if service binding should not be the default and instead the user should specify explicit list of modules via --add-modules.  It may also be useful to add jpackage --bind-services so that it can be supplied when invoking the jpackage command and pass it to jlink.

While we don't want to add too many such options, this one makes sense to reconsider if we decide to not pass it by default for modular apps.

> This can be an open issue to follow up after integration.

OK. We will file a follow-on JBS issue (for 13) to consider what the default for '--bind-services' should be for modular applications and whether we should add a '--bind-services' options to jpackage.

Comments
option --bind-services was added as JDK-8233594 so closing this as a dupe
12-11-2019

The current implementation is that we will add --bind-services argument unless the user has specified --add-modules. The assumption was that if user specified specific modules to add they could also include whatever service modules they wanted. User still has option of running jlink manually ane using --runtime-image arg to jpackage. It is still my opinion that if we want to add any other jlink options as jpackage options we should just add a generic --jlink-options option. This option could then default to the existing default set of options { --strip-debug, --no-header-files, --no-man-pages, --strip-native-commands. and sometimes --bind-services }
22-04-2019

We need to resolve this, either by making the change or closing as "Won't fix", for JDK 13 (else it would be an incompatible change after 13).
19-04-2019