You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Hervé Guillemet (Jira)" <ji...@apache.org> on 2023/02/08 19:52:00 UTC

[jira] [Commented] (MJLINK-65) Filter out automatic modules

    [ https://issues.apache.org/jira/browse/MJLINK-65?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17686087#comment-17686087 ] 

Hervé Guillemet commented on MJLINK-65:
---------------------------------------

* Jlink just throws an error when given an automatic module in the list of modules to include in the image. So my suggestion is to remove from this list the modules that are not true named modules.
 * Other projects won't break since this will only allow jlink to complete in cases where it would throw an error.
 * The dependency is not optional nor provided in the case of JavaFX. Here is how JavaFX module system works with maven:
 ** the user application depends on, eg,  artifact `javafx-graphics`. This artifact is an automatic module, it doesn't include any code but a pom that registers a maven depency towards the platform-dependent artifact, eg, `javafx-graphics-linux`, which is a named module.
 ** the user application, in the application module descriptor, requires module `javafx.graphics`, which is provided by artifact  `javafx-graphics-linux`

So the jlink archive must contain artifact `javafx-graphics-linux`, but not artifact `javafx-graphics`

 

Note: the usual way to build image with JavaFX is rather to use jmod, but it would be nice if it could work with maven artifacts too. Also other software may use a similar technic.

 

 

> Filter out automatic modules
> ----------------------------
>
>                 Key: MJLINK-65
>                 URL: https://issues.apache.org/jira/browse/MJLINK-65
>             Project: Maven JLink Plugin
>          Issue Type: New Feature
>    Affects Versions: 3.1.0
>            Reporter: Hervé Guillemet
>            Priority: Major
>
> The plugin currently adds to the jlink image all modules found in the Maven dependencies. If such modules are automatic modules, jlink will fail.
> This prevents, for instance, to build the image of an application using JavaFX jars since JavaFX uses an empty automatic module (e.g. in javafx-controls-17.0.2.jar) as a dependency bridge between applications and platform specific jars (e.g.  javafx-controls-17.0.2-linux.jar).
> Could you consider filtering out automatic modules ? 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)