Use case. JDK 25's AOT cache (JEP 514: Ahead-of-Time Command-Line Ergonomics, building on JEP 483) can cut JVM startup time by ~20–25%, but creating the cache requires executing the packaged launcher once ("training run") and placing the resulting .aot file plus a -XX:AOTCache=$APPDIR/... line in the launcher .cfg inside the app image — after jpackage has assembled the image, but before the installers are derived from it.
Problem. Jpackage#runJpackage performs app-image creation and installer packaging (--type deb/rpm/msi/dmg/pkg --app-image ...) within a single task action. There is no seam between the two steps: a doLast runs after the installers are already built, so any post-processing of the app image reaches only the app-image artifact, never the installers. Training a copy of the image is not viable either, since the AOT cache is validated against the exact runtime image it was trained on.
JabRef currently uses the doLast workaround for its app-image-only jabkit tool (JabRef/jabref#16791) but cannot extend it to the installer-shipping GUI application.
Proposal. An optional post-app-image step on the Jpackage task / javaModulePackaging extension, executed after performAppImageStep + copyAdditionalRessourcesToImageFolder and before installer packaging, receiving the app image directory. Possible shapes:
- an
Action<Directory>-style callback (simplest for consumers), or
- splitting app-image creation and installer packaging into two wired tasks (cleaner, but a larger/breaking change).
Open questions. Interaction with singleStepPackaging = true (no intermediate app image when only installers are requested — the hook would either force two-step packaging or be documented as unsupported there); interaction with build/configuration caching (the hook mutates task output mid-action, so its inputs must participate in up-to-date checks).
I am happy to contribute a PR for whichever shape you prefer.
Generated with 🤖 Claude Code
Use case. JDK 25's AOT cache (JEP 514: Ahead-of-Time Command-Line Ergonomics, building on JEP 483) can cut JVM startup time by ~20–25%, but creating the cache requires executing the packaged launcher once ("training run") and placing the resulting
.aotfile plus a-XX:AOTCache=$APPDIR/...line in the launcher.cfginside the app image — afterjpackagehas assembled the image, but before the installers are derived from it.Problem.
Jpackage#runJpackageperforms app-image creation and installer packaging (--type deb/rpm/msi/dmg/pkg --app-image ...) within a single task action. There is no seam between the two steps: adoLastruns after the installers are already built, so any post-processing of the app image reaches only theapp-imageartifact, never the installers. Training a copy of the image is not viable either, since the AOT cache is validated against the exact runtime image it was trained on.JabRef currently uses the
doLastworkaround for its app-image-onlyjabkittool (JabRef/jabref#16791) but cannot extend it to the installer-shipping GUI application.Proposal. An optional post-app-image step on the
Jpackagetask /javaModulePackagingextension, executed afterperformAppImageStep+copyAdditionalRessourcesToImageFolderand before installer packaging, receiving the app image directory. Possible shapes:Action<Directory>-style callback (simplest for consumers), orOpen questions. Interaction with
singleStepPackaging = true(no intermediate app image when only installers are requested — the hook would either force two-step packaging or be documented as unsupported there); interaction with build/configuration caching (the hook mutates task output mid-action, so its inputs must participate in up-to-date checks).I am happy to contribute a PR for whichever shape you prefer.
Generated with 🤖 Claude Code