目次

Version 6, last updated by dmclean62 at Nov 17 11:56 UTC

Using IntelliJ IDEA to develop Lift applications

At the moment (in absence of a proper Lift plug-in for IntelliJ), you can use IntelliJ as a code completion/syntax checking/import managing tool. You will need Maven, SBT and the Scala plug-in for IntelliJ. IntelliJ will manage your dependencies using the POM, you will build and run with SBT. Get all three, then proceed as follows.

Steps

  1. Use one of the Maven archetypes referenced elsewhere on this wiki to create a Lift project. The pom.xml will be used by IntelliJ to import your dependencies
  2. Create an SBT project on top of the Maven project (enter the project directory and run SBT)
  3. Create a new IntelliJ project from what results, using Import Project from External Model => Maven
  4. Add a Scala aspect to the project, employing Use Files. Point the plug-in to the project/boot subdirectory where SBT downloaded your Scala
  5. Develop with pleasure :)

Gotchas

  • The Scala plug-in does not treat implicits as dependencies yet. If you're importing implicits into a page (e.g., DSLs, e.g., the LIft JSON DSL), the dependency will be grayed out as if unused. It's not. Don't remove it, or optimize imports on that file - you will get cryptic compilation errors

Comments

  1. The Scala plugin in only being actively developed for the version 10 (X) release of IDEA which is currently in "Early Access Program" (pre-release). If you have questions about stability or usability of specific versions, please feel free to ask in the Google group/mailing list.
  2. It is perfectly acceptable to use Ant for developing in Lift. If your organization's management does not buy off on switching to SBT or Maven and you need assistance setting up an Ant build, please direct your questions to the Google group/mailing list.
  3. To enable full syntax checking in the Scala plugin:
    Mac: Command + alt/option + shift + e
    Windows: alt + control + shift + e