Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Develop a Scala/Lift Web App using Eclipse and Tomcat

So I have spent the past 11 hours now trying to get even the simplest Scala/Lift app to run on Tomcat through Eclipse. Apparently no one is trying to do this or it is the easiest thing in the world so no one has documented how they did it. Creating the code using a maven archetype and running it with mvn tomcat:run is no problem. Making it all work through Eclipse is another story. I will say this is my first attempt to do anything with Maven in Eclipse which has not helped any. I have tried both m2eclipse and eclipse-IAM. If anyone could walk me through the process from start to finish or point me to resources that can, that would be great. Thanks.


Version/Error Details

Scala 2.8 with Lift 2.1

If I use Scala 2.8 with Lift 2.1(?) with eclipse 3.5.2, scala-ide, and eclipse-iam, my pom.xml file tells me this:

Error: Error resolving version for 'org.scala-tools:maven-scala-plugin': Plugin requires Maven version 2.2.1

I created the project from the Maven Project Creation Wizard using this archetype definition:

<archetype>
    <groupId>net.liftweb</groupId>
    <artifactId>lift-archetype-blank_2.8.0</artifactId>
    <version>2.1-SNAPSHOT</version>
    <repository>http://scala-tools.org/repo-snapshots</repository>
    <description>Shawn's Custom Thinger</description>
</archetype>

From what I understand, the problem here is the pom.xml file created from the 2.1-SNAPSHOT requires Maven 2.2.1, but eclipse-iam does not use that version yet. I have not managed to find a way to use the Maven v2.2.1 that I have installed myself. Supposedly eclipse-iam does not allow use of an external maven install.

Other Attempts

I have tried building projects with this archetype:

<archetype>
    <groupId>net.liftweb</groupId>
    <artifactId>lift-archetype-jpa-blank</artifactId>
    <version>1.1-SNAPSHOT</version>
    <repository>http://scala-tools.org/repo-snapshots</repository>
    <description>Archetype - blank JPA project for Lift</description>
</archetype>

However, then I get runtime errors from Tomcat for a ClassNotFound error for my bootstrap.liftweb.Boot class. However, I can see that maven created a default Boot class for me.

m2eclipse

I got a project with no errors using m2eclipse, but I was having problems getting it deployed on Tomcat. I intend to revisit this one as I am curious if I did manage to get one project working, but had a case-sensitivity problem in the URL when I tried it. However, this process was much more manual. I would prefer an eclipse-iam solution if possible, but will take what I can get at this point.

like image 999
Marshmellow1328 Avatar asked Sep 17 '10 04:09

Marshmellow1328


1 Answers

I can't begin to describe my frustration with the same issue. Finally the only document that worked for me is this one: http://www.spenceruresk.com/2010/10/developing-with-lift-in-eclipse/

I think m2eclipse-scala plugin made the difference.

like image 84
Bahadır Yağan Avatar answered Sep 28 '22 09:09

Bahadır Yağan