Skip to end of metadata
Go to start of metadata
Your Rating: Results: PatheticBadOKGoodOutstanding! 1 rates

Here's a quick how to for setting up IntelliJ with the latest trunk of Magnolia.

Prerequisites:

  • 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:

Importing

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.

Generating

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.

Using FreeMarker

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.

  1. Aug 29, 2008

    Oliver, mvn idea:idea is what I was using before, but we're probably going to remove a bunch of now useless profiles from the pom files (which were only there to satisfy this), if the import thing is satisfying. (I'm still experimenting, and having quite a hard time getting IntelliJ to chill and stop reloading tons of projects all the time)