This small tutorial may seem overly simplified but I think that a lot of newbies out there will find it helpful. I also would consider using sbt instead of just maven but this tutorial covers just maven.
I have been developing using Lift for a little over a year now and I found the IDE choices grim. I tried Eclipse, Netbeans and IntelliJ. My clear favorite is IntelliJ. It does not specifically support the Lift Framework but it does have great support for Scala and Maven. Here’s how I set things up.

Download and Install Maven 2.2.1: http://maven.apache.org/download.html

You MUST set your M2_HOME environment variable and you must make sure the mvn executable is in your execution path. Methods to accomplish this vary from system to system.

Go to a directory where you want to create your Lift app and run something like this(varies depending on archetype)

1
2
3
4
5
6
7
mvn archetype:generate -U        \
     -DarchetypeGroupId=net.liftweb        \
     -DarchetypeArtifactId=lift-archetype-basic        \
     -DarchetypeVersion=2.0        \
     -DremoteRepositories=http://scala-tools.org/repo-releases        \
     -Dversion=0.1		\
     -DgroupId=com.morroni.jagger -DartifactId=store-jagger

Download and install intelliJ 9.02 Community Edition or Ultimate: http://www.jetbrains.com/idea/download/

Open up IntelliJ and goto the menu item IntelliJ->Preferences. Choose the Plugins menu on the left and click the Available tab at the top. Type “scala” to search for the relevant plugins. Highlight the Scala plugin and click the little disk/arrow icon to install them.
plugins1

Open up IntelliJ and goto File->New Project

Choose Import project from external model and click Next
openproject

Choose Maven and click Next
openproject2

Enter the location of the folder where you generated your maven project and click next
openproject3

Select both profile radio boxes and click Next
openproject4

Make sure the only Maven project available is selected and click Next
openproject5

Click Finish.

When you are ready to run your project, right click on it and select Run “store-jagger [jetty:run]”
runit

Open up a web browser and go to http://localhost:8080
scfreenshot

6 responses


Do you want to comment?

Comments RSS and TrackBack Identifier URI ?


Thanks for this. As you say, very useful for us newbies!

October 21, 2010 4:05 pm

When I run your example, it works great. If I try and change the archetype to something more recent, say lift-archetype-basic_2.8.0 and 2.2-M1 as the version, there is no run menu available when I import the project.

November 11, 2010 3:41 pm

I ran the following if you want to try it.

mvn archetype:generate -U \
-DarchetypeGroupId=net.liftweb \
-DarchetypeArtifactId=lift-archetype-basic_2.8.0 \
-DarchetypeVersion=2.2-M1 \
-DremoteRepositories=http://scala-tools.org/repo-releases \
-Dversion=0.1 \
-DgroupId=com.andyczerwonka.test -DartifactId=test

November 11, 2010 5:51 pm

Hi Andy,
I was able to reproduce your issue. I have two suggestions. The first would be to create a new maven configuration under the drop down next to the green run arrow. The second suggestion would be to use sbt. I pretty much use sbt for all my lift development at this point. I hope that helps. Thanks for reading our blog!

Larry

November 12, 2010 1:43 pm

I think I’d like to go with SBT. Do you still use IntelliJ with the Scala plugin? If so, what does your configuration look like?

November 14, 2010 11:05 am

Comment now!