Recently I had been trying to solve the problem of generating mac os .app from java jar file using maven plugin.
appbundle-maven-plugin is a popular plugin of doing this, but it doesn't work for M1 macs, as I've seen.
Then I came up with a very simple solution and created maven plugin that could generate mac .app with the structure below, with the ability to specify jdk and jar, other things as well, in plugin configs.
App.app
└── Contents
├── Info.plist
├── MacOS
│ └── App
├── Resources
│ ├── dock-icon.png
│ └── icon.icns
├── app
│ └── app.jar
└── jdk
├── ...
The logic behind this structure is that MacOS/App is a unix executable, it contains shell script that says something like java -jar app.jar (simplified), it has 3 lines, basically it runs the specified jar file with java inside the specified jdk, that's it.
This works perfectly, from my point of view. As it is very very simple, I suspect it may have some problems that I can't see myself. Also appbundle-maven-plugin generates some complicated unix executable, not human readable, so it's not a shell script.
Moreover, I've seen some apps that are built with java, none of those apps use approach similar to mine, their unix executables doesn't contain a shell script when I look into them.
So questions are: Is this a good approach? What problems it has? Is it ok to use this in production? If not what is a better and more standard one? I can't get how other apps generate a unix executable they have, as it's not a shell script.
Thanks.