I would like to create a DMG file from Java.
The reason why it needs to be Java is twofold: It must be part of our build farm (which currently runs on a non Mac OS X platform) and our build uses Maven (which pretty much means Java).
As far as I can a tell inside a DMG file can be an ISO9660 file system. I can create such beast using this but then I still need the part where the whole thing is wrapped in the DMG format. Something like iso2dmg
tool except I need it for Java.
When answering: Forget about the Maven part. If you have a Java solution then I can figure out the Maven stuff myself. (e.g. creating my own little Maven plugin if I need to).
The appbundle-maven-plugin works on both Linux and Mac to generate an app bundle(YourProgram.app) and then a .dmg. Make sure you have genisoimage as that's what it uses in Linux to create the dmg.
https://github.com/federkasten/appbundle-maven-plugin