Permalink
Browse files

Updates for #1385: Lift-2.5

  • Loading branch information...
1 parent 884332a commit 005c0b9215545740f133a2585b0cedf0b8e846ad @ldeck ldeck committed Jan 13, 2013
Showing with 249 additions and 155 deletions.
  1. +1 −1 lift-archetype-basic/pom.xml
  2. +32 −0 lift-archetype-basic/src/main/resources/archetype-resources/build.sbt
  3. +18 −18 lift-archetype-basic/src/main/resources/archetype-resources/pom.xml
  4. +0 −7 lift-archetype-basic/src/main/resources/archetype-resources/project/build.properties
  5. +0 −13 lift-archetype-basic/src/main/resources/archetype-resources/project/build/LiftProject.scala
  6. +14 −0 lift-archetype-basic/src/main/resources/archetype-resources/project/plugins.sbt
  7. +1 −0 lift-archetype-basic/src/main/resources/archetype-resources/sbt
  8. BIN lift-archetype-basic/src/main/resources/archetype-resources/sbt-launch-0.12.jar
  9. +2 −0 lift-archetype-basic/src/main/resources/archetype-resources/sbt.bat
  10. +23 −0 ...chetype-basic/src/main/resources/archetype-resources/src/main/resources/props/default.logback.xml
  11. +0 −1 lift-archetype-basic/src/main/resources/archetype-resources/src/main/resources/props/default.props
  12. +3 −5 lift-archetype-basic/src/main/resources/archetype-resources/src/main/scala/lib/DepencyFactory.scala
  13. +5 −7 lift-archetype-basic/src/main/resources/archetype-resources/src/main/scala/model/User.scala
  14. +7 −9 lift-archetype-basic/src/main/resources/archetype-resources/src/main/scala/snippet/HelloWorld.scala
  15. +16 −7 lift-archetype-basic/src/main/resources/archetype-resources/src/main/webapp/index.html
  16. +1 −1 lift-archetype-basic/src/main/resources/archetype-resources/src/main/webapp/static/index.html
  17. +16 −30 ...hetype-basic/src/main/resources/archetype-resources/src/main/webapp/templates-hidden/default.html
  18. +53 −19 ...ype-basic/src/main/resources/archetype-resources/src/main/webapp/templates-hidden/wizard-all.html
  19. +23 −0 lift-archetype-basic/src/main/resources/archetype-resources/src/test/resources/logback-test.xml
  20. +6 −6 lift-archetype-basic/src/main/resources/archetype-resources/src/test/scala/AppTest.scala
  21. +2 −2 lift-archetype-basic/src/main/resources/archetype-resources/src/test/scala/LiftConsole.scala
  22. +9 −8 lift-archetype-basic/src/main/resources/archetype-resources/src/test/scala/RunWebApp.scala
  23. +14 −18 ...rchetype-basic/src/main/resources/archetype-resources/src/test/scala/snippet/HelloWorldTest.scala
  24. +3 −3 pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>net.liftweb</groupId>
<artifactId>archetypes_2.9.1</artifactId>
- <version>2.4-SNAPSHOT</version>
+ <version>2.5-SNAPSHOT</version>
</parent>
<artifactId>lift-archetype-basic_2.9.1</artifactId>
<packaging>maven-archetype</packaging>
@@ -0,0 +1,32 @@
+name := "Lift 2.5 starter template"
+
+version := "0.0.1"
+
+organization := "net.liftweb"
+
+scalaVersion := "2.9.1"
+
+resolvers ++= Seq("snapshots" at "http://oss.sonatype.org/content/repositories/snapshots",
+ "releases" at "http://oss.sonatype.org/content/repositories/releases"
+ )
+
+seq(com.github.siasia.WebPlugin.webSettings :_*)
+
+unmanagedResourceDirectories in Test <+= (baseDirectory) { _ / "src/main/webapp" }
+
+scalacOptions ++= Seq("-deprecation", "-unchecked")
+
+libraryDependencies ++= {
+ val liftVersion = "2.5-M4"
+ Seq(
+ "net.liftweb" %% "lift-webkit" % liftVersion % "compile",
+ "net.liftweb" %% "lift-mapper" % liftVersion % "compile",
+ "net.liftmodules" %% "lift-jquery-module" % (liftVersion + "-2.0"),
+ "org.eclipse.jetty" % "jetty-webapp" % "8.1.7.v20120910" % "container,test",
+ "org.eclipse.jetty.orbit" % "javax.servlet" % "3.0.0.v201112011016" % "container,test" artifacts Artifact("javax.servlet", "jar", "jar"),
+ "ch.qos.logback" % "logback-classic" % "1.0.6",
+ "org.specs2" %% "specs2" % "1.12.1" % "test",
+ "com.h2database" % "h2" % "1.3.170"
+ )
+}
+
@@ -24,17 +24,17 @@
<maven.scaladoc.vscaladocVersion>1.2-m1</maven.scaladoc.vscaladocVersion>
<vscaladoc.links.liftweb.pathsufix>scaladocs/</vscaladoc.links.liftweb.pathsufix>
#if ($liftVersion.endsWith("SNAPSHOT"))
- <vscaladoc.links.liftweb.baseurl>http://scala-tools.org/mvnsites-snapshots/liftweb</vscaladoc.links.liftweb.baseurl>
+ <vscaladoc.links.liftweb.baseurl>https://oss.sonatype.org/content/repositories/snapshots/liftweb</vscaladoc.links.liftweb.baseurl>
#else
- <vscaladoc.links.liftweb.baseurl>http://scala-tools.org/mvnsites/liftweb</vscaladoc.links.liftweb.baseurl>
+ <vscaladoc.links.liftweb.baseurl>https://oss.sonatype.org/content/groups/scala-tools/liftweb</vscaladoc.links.liftweb.baseurl>
#end
</properties>
<repositories>
<repository>
<id>scala-tools.releases</id>
<name>Scala-Tools Dependencies Repository for Releases</name>
- <url>http://scala-tools.org/repo-releases</url>
+ <url>https://oss.sonatype.org/content/groups/scala-tools</url>
</repository>
<repository>
<id>java.net.maven2</id>
@@ -45,7 +45,7 @@
<repository>
<id>scala-tools.snapshots</id>
<name>Scala-Tools Dependencies Repository for Snapshots</name>
- <url>http://scala-tools.org/repo-snapshots</url>
+ <url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots/>
</repository>
#end
@@ -55,7 +55,7 @@
<pluginRepository>
<id>scala-tools.releases</id>
<name>Scala-Tools Plugins Repository for Releases</name>
- <url>http://scala-tools.org/repo-releases</url>
+ <url>https://oss.sonatype.org/content/groups/scala-tools</url>
</pluginRepository>
</pluginRepositories>
@@ -69,24 +69,24 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
- <version>0.9.26</version>
+ <version>1.0.6</version>
</dependency>
#elseif ($logBackend.equalsIgnoreCase("log4j"))
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
- <version>1.2.16</version>
+ <version>1.2.17</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
- <version>1.6.1</version>
+ <version>1.7.2</version>
</dependency>
#end
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
- <version>1.2.138</version>
+ <version>1.3.170</version>
<scope>runtime</scope>
</dependency>
<dependency>
@@ -98,7 +98,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.7</version>
+ <version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
@@ -108,9 +108,9 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>jetty</artifactId>
- <version>6.1.25</version>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-webapp</artifactId>
+ <version>8.1.8.v20121106</version>
<scope>test</scope>
</dependency>
<!-- for LiftConsole -->
@@ -149,7 +149,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
- <version>2.5</version>
+ <version>2.6</version>
<executions>
<execution>
<id>default-copy-resources</id>
@@ -174,9 +174,9 @@
</executions>
</plugin>
<plugin>
- <groupId>org.mortbay.jetty</groupId>
- <artifactId>maven-jetty-plugin</artifactId>
- <version>6.1.25</version>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>9.0.0.M4</version>
<configuration>
<contextPath>/</contextPath>
<scanIntervalSeconds>5</scanIntervalSeconds>
@@ -208,7 +208,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-eclipse-plugin</artifactId>
- <version>2.7</version>
+ <version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<additionalProjectnatures>
@@ -1,7 +0,0 @@
-project.organization=$groupId
-project.name=$artifactId
-project.version=$version
-sbt.version=0.7.4
-def.scala.version=2.7.7
-build.scala.versions=$scalaVersion
-project.initialize=false
@@ -1,13 +0,0 @@
-import sbt._
-
-class LiftProject(info: ProjectInfo) extends DefaultWebProject(info) {
-
- // Add Maven Local repository for SBT to search for (disable if this doesn't suit you)
- val mavenLocal = "Local Maven Repository" at "file://"+Path.userHome+"/.m2/repository"
-
-#if ($liftVersion.endsWith("SNAPSHOT"))
- // Add snapshot repo, since Lift SNAPSHOT in use
- val snapshots = ScalaToolsSnapshots
-#end
-
-}
@@ -0,0 +1,14 @@
+libraryDependencies <+= sbtVersion(v => v match {
+ case "0.11.0" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.0-0.2.8"
+ case "0.11.1" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.1-0.2.10"
+ case "0.11.2" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.2-0.2.10"
+ case "0.11.3" => "com.github.siasia" %% "xsbt-web-plugin" % "0.11.3-0.2.11.1"
+ case "0.12.0" => "com.github.siasia" %% "xsbt-web-plugin" % "0.12.0-0.2.11.1"
+ case "0.12.1" => "com.github.siasia" %% "xsbt-web-plugin" % "0.12.0-0.2.11.1"
+})
+
+//Uncoment this line to enable the sbt idea plugin
+addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0")
+
+//Uncoment this line to enable the sbt eclipse plugin
+addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")
@@ -0,0 +1 @@
+java -Xmx1024M -Xss2M -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -jar `dirname $0`/sbt-launch-0.12.jar "$@"
@@ -0,0 +1,2 @@
+set SCRIPT_DIR=%~dp0
+java -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx1024M -Xss2M -jar "%SCRIPT_DIR%\sbt-launch-0.12.jar" %*
@@ -0,0 +1,23 @@
+<configuration>
+ <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
+ <encoder class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
+ </encoder>
+ </appender>
+ <appender name="FILE" class="ch.qos.logback.core.FileAppender">
+ <file>console.devmode.log</file>
+ <append>true</append>
+ <encoder>
+ <pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
+ </encoder>
+ </appender>
+
+
+
+ <logger name="code.snippet" level="info" />
+ <logger name="net.liftweb" level="warn" />
+ <logger name="bootstrap.liftweb" level="info" />
+ <root level="warn">
+ <appender-ref ref="STDOUT" />
+ </root>
+</configuration>
@@ -1 +0,0 @@
-# Properties in this file will be read when running in dev mode
@@ -1,11 +1,11 @@
-package ${package} {
-package lib {
+package ${package}
+package lib
import net.liftweb._
import http._
import util._
import common._
-import _root_.java.util.Date
+import java.util.Date
/**
* A factory for generating new instances of Date. You can create
@@ -53,5 +53,3 @@ sealed abstract class Changer {
}
}
*/
-}
-}
@@ -1,9 +1,9 @@
-package ${package} {
-package model {
+package ${package}
+package model
-import _root_.net.liftweb.mapper._
-import _root_.net.liftweb.util._
-import _root_.net.liftweb.common._
+import net.liftweb.mapper._
+import net.liftweb.util._
+import net.liftweb.common._
/**
* The singleton that has methods for accessing the database
@@ -34,5 +34,3 @@ class User extends MegaProtoUser[User] {
}
}
-}
-}
@@ -1,17 +1,17 @@
-package ${package} {
-package snippet {
+package ${package}
+package snippet
-import _root_.scala.xml.{NodeSeq, Text}
-import _root_.net.liftweb.util._
-import _root_.net.liftweb.common._
-import _root_.java.util.Date
+import scala.xml.{NodeSeq, Text}
+import net.liftweb.util._
+import net.liftweb.common._
+import java.util.Date
import ${package}.lib._
import Helpers._
class HelloWorld {
lazy val date: Box[Date] = DependencyFactory.inject[Date] // inject the date
- // bind the date into the element with id "time"
+ // replace the contents of the element with id "time" with the date
def howdy = "#time *" #> date.map(_.toString)
/*
@@ -21,5 +21,3 @@ class HelloWorld {
*/
}
-}
-}
@@ -1,9 +1,18 @@
-<div class="lift:surround?with=default;at=content">
- <h2>Welcome to your project!</h2>
- <p>
- <div class="lift:helloWorld.howdy">
- Welcome to $artifactId at <span id="time">The current time</span>
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta content="text/html; charset=UTF-8" http-equiv="content-type" />
+ <title>Home</title>
+ </head>
+ <body class="lift:content_id=main">
+ <div id="main" class="lift:surround?with=default;at=content">
+ <h2>Welcome to your project!</h2>
+ <p>
+ <span class="lift:helloWorld.howdy">
+ Welcome to your Lift app at <span id="time">Time goes here</span>
+ </span>
+ </p>
</div>
- </p>
-</div>
+ </body>
+</html>
@@ -1,4 +1,4 @@
-<div class="lift:surround?with=default;at=content">
+<div id="main" class="lift:surround?with=default;at=content">
Static content... everything you put in the /static
directory will be served without additions to SiteMap
</div>
Oops, something went wrong.

0 comments on commit 005c0b9

Please sign in to comment.