beryx / badass-jlink-plugin

Create a custom runtime image of your modular application
https://badass-jlink-plugin.beryx.org
Apache License 2.0
379 stars 25 forks source link

Passing --temp parameter to jpackage doesn't work as expected? #193

Closed dawidm closed 3 years ago

dawidm commented 3 years ago

I'm using the plugin on Linux. As far as I understand this:

jpackage {
imageOptions = ['--temp', 'jpackagetmp']
...

should pass --temp parameter to the jpackage command. It seems to be working with jpackage gradle target because if provided directory is not empty an error occurs.

Error: temp (jpackagetmp) must be non-existant or empty directory

If directory is empty or doesn't exist (as expected by the jpackage tool) it doesn't cause any errors but temp files are created in /tmp/... directory and removed after finishing instead of being created in provided directory and not being removed (as described here https://docs.oracle.com/en/java/javase/14/docs/specs/man/jpackage.html).

Additionally I've tried to use jpackage alone (without gradle) for example: jpackage -n test --type rpm --app-image build/image --temp jptmp And temp files are created in jptmp directory and not removed, as expected.

dawidm commented 3 years ago

OK, I was doing it wrong, --temp option should be added in installerOptions. It works as supposed, but works only for generating one package in a single run (when generating two packages, temp directory is full after making the first one which causes an error).