问题描述
我想从Java创建文件。
I would like to create a DMG file from Java.
它需要成为Java的原因有两个:它必须是我们的构建农场(目前在非Mac OS X平台上运行)的一部分,我们的构建使用Maven(这几乎意味着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).
据我所知,DMG文件中的内容可以是ISO9660文件系统。我可以使用创建这样的野兽,但是我仍然需要整个事物以DMG格式包装的部分。像 iso2dmg
工具之类的东西,除了我需要它用于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.
回答时:忘记Maven部分。如果您有Java解决方案,那么我可以自己找出Maven的东西。 (例如,如果需要,创建我自己的小Maven插件)。
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).
推荐答案
appbundle-maven-plugin适用于Linux和Mac生成应用程序包(YourProgram.app),然后生成.dmg。确保你有genisoimage,因为它在Linux中用来创建dmg。
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.
<plugin>
<groupId>sh.tak.appbundler</groupId>
<artifactId>appbundle-maven-plugin</artifactId>
<version>1.2.0</version>
</plugin>
这篇关于从Java创建Mac .dmg文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!