On macOS, I am using Javapackager to make an Application.app
bundle (called a disk image) from my Application.jar
Java archive:
javapackager \
-deploy \
-native image \
-srcfiles Application.jar \
-outdir dist \
-outfile Application \
-appclass Application
The resulting Application.app
bundle is a directory with the following layout:
Application.app
|--Contents
|--Info.plist
|--PkgInfo
|--Java
| |--Application.jar
|--MacOS
| |--Application
|--Resources
However I have some <language>.lproj
directories (which hold InfoPlist.strings
files for localizing some strings of the Info.plist
file, cf. Apple's Developer website) on my file system that need to be copied in the Resources
directory of the Application.app
layout, like this:
Application.app
|--Contents
|--Info.plist
|--PkgInfo
|--Java
| |--Application.jar
|--MacOS
| |--Application
|--Resources
|--en.lproj
|--InfoPlist.strings
|--fr.lproj
|--InfoPlist.strings
How can I tell Javapackager to do that? (I do not want to copy the <language>.lproj
directories myself in the Application.app
bundle after its creation, as it would break its signature.)
If you use (or can use) maven, you can do it with the assembly plugin.
First of all, you can use the exec plugin to perform the
jlink
/javapackage
steps and on completion (in thepackage
phase), copy your missing information to the destination folder.Maven automatizes it for you and you don't have to perform manually those steps.
For instance: