Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration to provide jlink options #104

Open
abhinayagarwal opened this issue Oct 7, 2020 · 1 comment · May be fixed by #109
Open

Configuration to provide jlink options #104

abhinayagarwal opened this issue Oct 7, 2020 · 1 comment · May be fixed by #109

Comments

@abhinayagarwal
Copy link
Collaborator

The current <option> configuration is used to provide options to the java command for both javafx:run and javafx:jlink goals. In case of javafx:jlink, the options are passed to the launcher script which seems to work well.

However, user may need to pass options to jlink command. There is no way to do it right now.

My suggestion is to include a new configuration jlinkOptions which would enable users to define flags which will be directly passed to the jlink command.

@HGuillemet
Copy link

As explained in a previous issue, we need this kind of options in projects where the required modules are determined dynamically by maven. Using the newly merged PR 92, the run goal can now be configured with something like:

  <runtimePathOption>MODULEPATH</runtimePathOption>
  <options>--add-modules ALL-MODULE-PATH</options>

This brings all maven dependencies into the module graph. But we now need the ability to tell jlink to also add all dependencies to the image.
Something like you suggest (and already start to implement) would do:

  <jlinkOptions>--add-modules ALL-MODULE-PATH</jlinkOptions>

Or you could consider that all modules that were needed on the module path to javafx:run are also needed in the image and make this the default.
Or you could do something still more clever by automatically append in --add-modules all modules in the module path but only NAMED modules, since jlink will fail to add automatic modules to the image.

Another related issue: since mainClass is a required option without default value, the <plugin> blocks must have a child <configuration> block with at least <mainClass>. So we must have a common <configuration> block for both goals. However if run and jlink need different values for the <option> parameter, we are stuck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants