I came across this post and this Maven plugin today. Call me cynical, but I was shocked when it worked out of the box, building our application as a Mac friendly .app which can be run with a double click.

To test it out, all I did was change into our application’s trunk directory and ran:

mvn package osxappbundle:bundle -DmainClass=com.mypkg.MyMain

And it worked!

So I extended integrated it into our pom.xml with the following. Now whenever our app is packaged on a Mac, in addition to the other artifacts, an .app, .dmg, and .zip of the My App tool will be created.


   ....
        
            package-osx-bundle
            
                
                    mac
                
            
            
                
                    
                        org.codehaus.mojo
                        osxappbundle-maven-plugin
                        
                            com.mypkg.MyMain
                            My App
                            1.5+
                        
                        
                            
                                package
                                
                                
                                    bundle