Packaging of Java applications for Mac OS X with Maven on Linux or Windows

Apple uses application bundles for packaging applications. An application bundle is simply “a directory that allows related resources such as an application’s executable and its graphics to be grouped together, appearing as a single file to the user.”

There are a couple of maven plugins which attempt to help creating application bundles. One of them is osxappbundle-maven-plugin which doesn’t support Java 7 and higher because it depends on discontinued Apple’s Java launcher. The other one, appbundler-plugin, was supposed to address the shortcoming above but it still suffers from another severe limitation: it requires OSX environment. If you use CI server it makes a lot of sense to maintain a build script that has no dependency on the platform.

Luckily, Oracle provides AppBundler which supports all modern Java runtimes (including Java 7, 8) and runs everywhere.

Let’s get to the practical part. AppBundler is provided as a jar file and appears to be an Ant task. Unfortunately it is not available in Maven Central Repository so you will need to install it locally or deploy it to your private maven repository (personally I use Nexus for this). Here is a fragment of my maven pom with properly configured maven-antrun-plugin:

Detailed information about parameters of the AppBundler task can be found here.

Share on FacebookShare on LinkedInShare on Google+Tweet about this on TwitterPin on PinterestShare on RedditDigg this

Vitaly Tsaplin

Hey, I am Vitaly and this is my blog. I live in Basel and work at Adobe.

More Posts - Website

Follow Me:
TwitterFacebookLinkedInGoogle Plus

2 thoughts on “Packaging of Java applications for Mac OS X with Maven on Linux or Windows

Leave a Comment

Time limit is exhausted. Please reload CAPTCHA.