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

macOS jpackage bug results in errors when Java "runtime is already signed" #120

Closed msgilligan closed 3 years ago

msgilligan commented 4 years ago

This is not a bug in badass-jlink-plugin, but appears to have been introduced in JDK 14.ea.36 It does not seem to occur in JDK 14.ea.34.

Here's the bug report: https://bugs.openjdk.java.net/browse/JDK-8237607

I'm not sure if there are any workarounds. The upstream fix is to add a -f option to the codesign command, but I don't see a way to add this option to the jpackage command line parameters.

Burtan commented 3 years ago

Did anybody succeed in signing his JavaFX app with this plugin?

msgilligan commented 3 years ago

Yes, I have.

Burtan commented 3 years ago

Can you share your config?

msgilligan commented 3 years ago

Can you share your config?

https://github.com/SupernautApp/SupernautFX/blob/master/supernaut-fx-sample-hello/build.gradle#L79-L120

And set signJPackageImages to true, in gradle.properties

Note that I only tested this on macOS and I haven't built a signed image for about 6 months.

msgilligan commented 3 years ago

I just tested Supernaut Sample Hello signing on macOS (using JDK 16) and it was successful. I use the following commands to verify:

$ codesign --verify --verbose supernaut-fx-sample-hello/build/jpackage/SupernautFX\ Hello.app
supernaut-fx-sample-hello/build/jpackage/SupernautFX Hello.app: valid on disk
supernaut-fx-sample-hello/build/jpackage/SupernautFX Hello.app: satisfies its Designated Requirement

$ spctl --assess --verbose=6 supernaut-fx-sample-hello/build/jpackage/SupernautFX\ Hello.app
supernaut-fx-sample-hello/build/jpackage/SupernautFX Hello.app: accepted
source=Developer ID
Burtan commented 3 years ago

Thanks!