Using Maven sometimes becomes a pain for a large project. Compiling sometimes takes forever. Recently I heard a tip on our office floor that if I use a RamDisk for maven repository it may be faster. So I tried to find out easy way to setup the RamDisk on Mac OS X (Snowleopard). Here’s how I did it.
Though you can use commands to create the memory based file system, there’s an excellent free preference pane from here and install it. It is pretty straight forward from there, make sure you check Save in disk image and Self auto restore. In this way your RamDisk will be saved to the disk and restored automatically when you start the session. Now move your maven repository which defaults to ~/.m2 in Mac OS X to the newly created RamDisk. Make sure you update the location of repository in your maven’s configuration settings.xml.
If your project is small enough, you can even move the source code to the RamDisk and start up from there. I found the speed to be pretty good since the disk I/O is now minimal.