Lift 2.0 + Scala 2.8 + Maven, in Eclipse!

I got the latest Scala 2.8 and Lift 2.0 all working with Eclipse and Maven.  Here’s the relevant pom.xml :


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
 <modelVersion>4.0.0</modelVersion>
 <groupId>com.myproject</groupId>
 <artifactId>myproject</artifactId>
 <version>1.0-SNAPSHOT</version>
 <packaging>war</packaging>
 <name>myproject</name>
 <inceptionYear>2007</inceptionYear>
 <properties>
 <scala.version>2.8.0.RC6</scala.version>
 </properties>

 <repositories>
 <repository>
 <id>scala-tools.org</id>
 <name>Scala-Tools Maven2 Repository</name>
 <url>http://scala-tools.org/repo-releases</url>
 </repository>
 <repository>
 <id>scala-tools.org snap</id>
 <name>Scala-Tools Maven2 Repository</name>
 <url>http://scala-tools.org/repo-snapshots</url>
 </repository>
 </repositories>

 <pluginRepositories>
 <pluginRepository>
 <id>scala-tools.org</id>
 <name>Scala-Tools Maven2 Repository</name>
 <url>http://scala-tools.org/repo-releases</url>
 </pluginRepository>
 <pluginRepository>
 <id>scala-tools.org snap</id>
 <name>Scala-Tools Maven2 Repository</name>
 <url>http://scala-tools.org/repo-snapshots</url>
 </pluginRepository>
 </pluginRepositories>

 <dependencies>
 <dependency>
 <groupId>postgresql</groupId>
 <artifactId>postgresql</artifactId>
 <version>8.4-701.jdbc4</version>
 </dependency>
 <dependency>
 <groupId>mysql</groupId>
 <artifactId>mysql-connector-java</artifactId>
 <version>5.1.12</version>
 </dependency>

 <dependency>
 <groupId>org.scala-lang</groupId>
 <artifactId>scala-library</artifactId>
 <version>${scala.version}</version>
 </dependency>
 <dependency>
 <groupId>net.liftweb</groupId>
 <artifactId>lift-core</artifactId>
 <version>2.0-scala280-SNAPSHOT</version>
 </dependency>
 <dependency>
 <groupId>net.liftweb</groupId>
 <artifactId>lift-mapper</artifactId>
 <version>2.0-scala280-SNAPSHOT</version> <!-- or 1.1-SNAPSHOT, etc -->
 </dependency>
 <dependency>
 <groupId>org.apache.derby</groupId>
 <artifactId>derby</artifactId>
 <version>10.4.2.0</version>
 </dependency>
 <dependency>
 <groupId>javax.servlet</groupId>
 <artifactId>servlet-api</artifactId>
 <version>2.5</version>
 <scope>provided</scope>
 </dependency>
 <dependency>
 <groupId>junit</groupId>
 <artifactId>junit</artifactId>
 <version>4.5</version>
 <scope>test</scope>
 </dependency>
 <dependency>
 <groupId>org.mortbay.jetty</groupId>
 <artifactId>jetty</artifactId>
 <version>[6.1.6,)</version>
 <scope>test</scope>
 </dependency>
 <dependency>
 <groupId>org.scala-tools.testing</groupId>
 <artifactId>specs</artifactId>
 <version>1.6.1-2.8.0.Beta1-RC6</version>
 <scope>test</scope>
 </dependency>
 <!-- for LiftConsole -->
 <dependency>
 <groupId>org.scala-lang</groupId>
 <artifactId>scala-compiler</artifactId>
 <version>${scala.version}</version>
 <scope>test</scope>
 </dependency>
 </dependencies>

 <build>
 <sourceDirectory>src/main/scala</sourceDirectory>
 <testSourceDirectory>src/test/scala</testSourceDirectory>
 <plugins>
 <plugin>
 <groupId>org.scala-tools</groupId>
 <artifactId>maven-scala-plugin</artifactId>
 <version>2.12</version>
 <executions>
 <execution>
 <goals>
 <goal>compile</goal>
 <goal>testCompile</goal>
 </goals>
 </execution>
 </executions>
 <configuration>
 <scalaVersion>${scala.version}</scalaVersion>
 </configuration>
 </plugin>
 <plugin>
 <groupId>org.mortbay.jetty</groupId>
 <artifactId>maven-jetty-plugin</artifactId>
 <configuration>
 <contextPath>/</contextPath>
 <scanIntervalSeconds>5</scanIntervalSeconds>
 </configuration>
 </plugin>
 <plugin>
 <groupId>net.sf.alchim</groupId>
 <artifactId>yuicompressor-maven-plugin</artifactId>
 <executions>
 <execution>
 <goals>
 <goal>compress</goal>
 </goals>
 </execution>
 </executions>
 <configuration>
 <nosuffix>true</nosuffix>
 </configuration>
 </plugin>
 <plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-eclipse-plugin</artifactId>
 <configuration>
 <downloadSources>true</downloadSources>
 <excludes>
 <exclude>org.scala-lang:scala-library</exclude>
 </excludes>
 <classpathContainers>
 <classpathContainer>ch.epfl.lamp.sdt.launching.SCALA_CONTAINER</classpathContainer>
 </classpathContainers>
 <projectnatures>
 <java.lang.String>ch.epfl.lamp.sdt.core.scalanature</java.lang.String>
 <java.lang.String>org.eclipse.jdt.core.javanature</java.lang.String>
 </projectnatures>
 <buildcommands>
 <java.lang.String>ch.epfl.lamp.sdt.core.scalabuilder</java.lang.String>
 </buildcommands>
 </configuration>
 </plugin>
 <plugin>
 <groupId>org.kohsuke.jetty</groupId>
 <artifactId>jetty-maven-plugin</artifactId>
 <version>7.0.0pre1</version>
 <configuration></configuration>
 </plugin>
 </plugins>
 </build>
 <reporting>
 <plugins>
 <plugin>
 <groupId>org.scala-tools</groupId>
 <artifactId>maven-scala-plugin</artifactId>
 <configuration>
 <scalaVersion>${scala.version}</scalaVersion>
 </configuration>
 </plugin>
 </plugins>
 </reporting>
</project>

About xclu
I am a Java software developer with over 10 years of experience. I work primarily in web development, accounting systems, reporting and analytics. I like to play around with Scala and other new technologies at home.

Leave a comment