How to use jlink or jpackage without other plugin?

I can’t find any description in the Gradle documents about jlink and jpackage supports.
Before that I’m trying to use org.beryx.jlink. But look like the plugin has bad supports for Auto-Module-Name attribute in the MANIFEST.MF.
So, are there anything about it?
Thank you.

There is no built-in support for jlink or jpackage.
We just use an Exec task or exec { ... } closure to call it.
You also have to be sensitive to which jlink you use.
Previously we took the jlink of the Java that runs Gradle by using java.util.spi.ToolProvider,
but recently that broke when we ran Gradle with Java 11.0.11 but tried to jlink a Java 11.0.19 JRE,
because the Java devs introduced a major breaking change in a minor update, where the hashsum calculation for JMODs changes, which causes that for example 11.0.11 jlink cannot run on 11.0.19 JMODs and 11.0.19 jlink cannot run on 11.0.11 JMODs.
For us I changed the logic, so that it always uses the jlink tool of the target JDK to prevent such problems in the future.

Are there any plan to add to add supports for it?

I have no idea, I’m not affiliated to Gradle

1 Like