Here's a quick how to for setting up IntelliJ with the latest trunk of Magnolia.
- Running on a Unix system, OSX, or having cygwin installed on your Windows machine (how could you not?)
- Having the 1.5 of the subversion client.
- Using IntelliJ 7 or more recent.
Checkout everything from the community subversion repository:
If you only want parts of this (for instance, you might not be interested in all modules), I'll simply advise to pick what you need from http://svn.magnolia.info/svn/community/ and do what the checkout.sh script does manually.
Creating an IntelliJ IDEA project
From here on you have two options:
Start IntelliJ, create a new project with the "Import project from external model" option, and "Maven" as the type, give it the
magnolia-subversion-repo/community directory as its root. Once IntelliJ has figured out all the modules which are in there, it will ask which ones you want to import. Take your pick, but make sure you uncheck the archetypes skeletons(which are easily recognizable, as their group and artifact IDs contains $'s. You don't need to select a specific profile. Now go get a coffee. Or smoke a cigarette. Or do something healthier if you are so inclined, but this is gonna take a moment, as it will import all the projects you just checked out and selected.
Instead of importing, you can also run
and let the Maven IDEA Plugin create project files for you. Just doubleclick on the file with IDEA icon/ipr-extension to start IDEA and load the project.
To get hot-swap on FreeMarker files (and probably other resources), you need to "make module". Somehow, as soon as a webapp module is present in your project, the resources are "packaged" (as opposed to "compiled"), and therefore not copied anymore to the module's own output folder, but rather to the webapp's.
See http://devnet.jetbrains.net/message/5317525#5317525 for updates. Turns out we don't even need to do anything to FreeMarker caching nor template loaders, but as far as my experiments go, the only way to get the template to be refreshed is to "make module".
I advise assigning a keyboard shortcut to "make module" such as ⌘-M or Alt-M.