@@ -105,6 +105,10 @@ Or, for convenience, let the plugin pick the target fitting the machine you run
105
105
106
106
There are some additional configuration options that can be used if needed.
107
107
All options have a default. Only configure what you need in addition.
108
+ For more information about the available options, consult the
109
+ [ jpackage] ( https://docs.oracle.com/en/java/javase/24/docs/specs/man/jpackage.html ) and
110
+ [ jlink] ( https://docs.oracle.com/en/java/javase/24/docs/specs/man/jlink.html )
111
+ (for ` jlinkOptions ` ) documentation.
108
112
109
113
``` kotlin
110
114
javaModulePackaging {
@@ -219,6 +223,46 @@ To avoid re-compilation of the Java code on each of the runners, you can run a
219
223
The [ java-module-system] ( https://github.com/jjohannes/java-module-system ) project is an example that
220
224
uses GitHub actions with a Gradle remote build cache.
221
225
226
+ ## FAQ
227
+
228
+ ### How does the plugin interact with the ` jpackage ` command?
229
+
230
+ By default, dhe plugin calls ` jpackage ` in two steps:
231
+
232
+ 1 . Build ` --type app-image ` as a package-type independent image folder. This is where ` jlink ` is involved.
233
+ 2 . Build OS-specific packages via ` --type <package-type> ` .
234
+ This may be called several times for the same target (e.g. ` exe ` and ` msi ` on Windows).
235
+
236
+ OS-independent options can be configured through the extension:
237
+
238
+ ``` kotlin
239
+ javaModulePackaging {
240
+ applicationName = " app" // defaults to project name
241
+ applicationVersion = " 1.0" // defaults to project version
242
+ applicationDescription = " Awesome App"
243
+ vendor = " My Company"
244
+ copyright = " (c) My Company"
245
+ jlinkOptions.addAll(" --no-header-files" , " --no-man-pages" , " --bind-services" )
246
+ addModules.addAll(" additional.module.to.include" )
247
+ verbose = false
248
+ }
249
+ ```
250
+
251
+ OS-specific options can be defined inside a target:
252
+
253
+ ``` kotlin
254
+ javaModulePackaging {
255
+ target(" windows2020" ) { // address target by name
256
+ options.addAll(" --win-dir-chooser" , " --win-shortcut" , " --win-menu" )
257
+ }
258
+ targetsWithOs(" windows" ) { // all targets of for a certain os
259
+ // ...
260
+ }
261
+ }
262
+ ```
263
+
264
+ You can tell the plugin to perform packaging in one step by setting the ` singleStepPackaging = true ` option on a target.
265
+
222
266
# Disclaimer
223
267
224
268
Gradle and the Gradle logo are trademarks of Gradle, Inc.
0 commit comments