Permalink
Browse files

#1470: update archetypes for scala-2.10[.2] and lift 2.5.1

  • Loading branch information...
1 parent a331a07 commit ab1e21cf992d9f73b016426d25a7ffcfec13beba @ldeck ldeck committed Jul 7, 2013
Showing with 477 additions and 127 deletions.
  1. +5 −8 lift-archetype-basic/pom.xml
  2. +66 −9 lift-archetype-basic/src/main/resources/archetype-resources/pom.xml
  3. +1 −1 lift-archetype-basic/src/main/resources/archetype-resources/src/test/scala/LiftConsole.scala
  4. +3 −3 ...rchetype-basic/src/main/resources/archetype-resources/src/test/scala/snippet/HelloWorldTest.scala
  5. +5 −8 lift-archetype-blank/pom.xml
  6. +64 −7 lift-archetype-blank/src/main/resources/archetype-resources/pom.xml
  7. +1 −1 lift-archetype-blank/src/main/resources/archetype-resources/src/test/scala/LiftConsole.scala
  8. +3 −3 ...rchetype-blank/src/main/resources/archetype-resources/src/test/scala/snippet/HelloWorldTest.scala
  9. +5 −8 lift-archetype-jpa-basic/pom.xml
  10. +46 −5 lift-archetype-jpa-basic/src/main/resources/archetype-resources/pom.xml
  11. +1 −1 ...-jpa-basic/src/main/resources/archetype-resources/spa/src/main/scala/model/CurrencyUserType.scala
  12. +1 −1 ...chetype-jpa-basic/src/main/resources/archetype-resources/spa/src/main/scala/model/EnumvType.scala
  13. +12 −7 lift-archetype-jpa-basic/src/main/resources/archetype-resources/web/pom.xml
  14. +1 −1 lift-archetype-jpa-basic/src/main/resources/archetype-resources/web/src/test/scala/LiftConsole.scala
  15. +5 −8 lift-archetype-jpa-blank-single/pom.xml
  16. +52 −7 lift-archetype-jpa-blank-single/src/main/resources/archetype-resources/pom.xml
  17. +1 −1 ...rchetype-jpa-blank-single/src/main/resources/archetype-resources/src/test/scala/LiftConsole.scala
  18. +5 −8 lift-archetype-jpa-blank/pom.xml
  19. +47 −5 lift-archetype-jpa-blank/src/main/resources/archetype-resources/pom.xml
  20. +11 −7 lift-archetype-jpa-blank/src/main/resources/archetype-resources/web/pom.xml
  21. +1 −1 lift-archetype-jpa-blank/src/main/resources/archetype-resources/web/src/test/scala/LiftConsole.scala
  22. +5 −8 lift-archetype-mvc/pom.xml
  23. +65 −8 lift-archetype-mvc/src/main/resources/archetype-resources/pom.xml
  24. +1 −1 lift-archetype-mvc/src/main/resources/archetype-resources/src/test/scala/LiftConsole.scala
  25. +70 −10 pom.xml
@@ -16,22 +16,19 @@
~ limitations under the License.
-->
-<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/xsd/maven-4.0.0.xsd">
+<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.liftweb</groupId>
- <artifactId>archetypes_2.9.1</artifactId>
+ <artifactId>archetypes_2.10</artifactId>
<version>2.5.1-SNAPSHOT</version>
</parent>
- <artifactId>lift-archetype-basic_2.9.1</artifactId>
+ <artifactId>lift-archetype-basic_2.10</artifactId>
<packaging>maven-archetype</packaging>
- <properties>
- <lift.version>${project.parent.version}</lift.version>
- <maven.resources.escapeString>\</maven.resources.escapeString>
- </properties>
-
<!--
~ More Project Information
-->
@@ -3,10 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- #set($scala_version_unevaled = '\${scala.version}')
- #set($project_basedir = '\${project.basedir}')
- #set($project_build_sourceEncoding_unevaled = '\${project.build.sourceEncoding}')
- #set($project_build_directory_unevaled = '\${project.build.directory}')
+#set($scala_pre_210 = $scalaVersion.compareTo("2.10") < 0)
+#set($scala_version_unevaled = '\${scala.version}')
+#set($scala_major_minor_version_unevaled = '\${scala.majorMinorVersion}')
+#set($lift_version_unevaled = '\${lift.version}')
+#set($lift_major_minor_version_unevaled = '\${lift.majorMinorVersion}')
+#set($project_basedir = '\${project.basedir}')
+#set($project_build_sourceEncoding_unevaled = '\${project.build.sourceEncoding}')
+#set($project_build_directory_unevaled = '\${project.build.directory}')
<modelVersion>4.0.0</modelVersion>
<groupId>$groupId</groupId>
@@ -16,7 +20,11 @@
<name>$artifactId Project</name>
<inceptionYear>2010</inceptionYear>
<properties>
+ <lift.version>$liftVersion</lift.version>
+ <!-- <lift.majorMinorVersion> @see regex-property executions </lift.majorMinorVersion> -->
<scala.version>$scalaVersion</scala.version>
+ <!-- <scala.majorMinorVersion> @see regex-property executions </scala.majorMinorVersion> -->
+
<!-- Common plugin settings -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>$project_build_sourceEncoding_unevaled</project.reporting.outputEncoding>
@@ -62,13 +70,21 @@
<dependencies>
<dependency>
<groupId>net.liftweb</groupId>
- <artifactId>lift-mapper_$scalaVersion</artifactId>
- <version>$liftVersion</version>
+#if ($scala_pre_210)
+ <artifactId>lift-mapper_${scala.version}</artifactId>
+#else
+ <artifactId>lift-mapper_${scala.majorMinorVersion}</artifactId>
+#end
+ <version>$lift_version_unevaled</version>
</dependency>
<dependency>
<groupId>net.liftmodules</groupId>
- <artifactId>lift-jquery-module_$scalaVersion</artifactId>
- <version>${liftVersion}-2.0</version>
+#if ($liftVersion.compareTo("2.5") < 0)
+ <artifactId>lift-jquery-module_${scala.version}</artifactId>
+#else
+ <artifactId>lift-jquery-module_${lift.majorMinorVersion}_${scala.majorMinorVersion}</artifactId>
+#end
+ <version>[2.4,3.0)</version>
</dependency>
#if ($logBackend.equalsIgnoreCase("logback"))
<dependency>
@@ -108,7 +124,11 @@
</dependency>
<dependency>
<groupId>org.specs2</groupId>
+#if ($scala_pre_210)
<artifactId>specs2_${scala.version}</artifactId>
+#else
+ <artifactId>specs2_${scala.majorMinorVersion}</artifactId>
+#end
<version>${specs.version}</version>
<scope>test</scope>
</dependency>
@@ -122,7 +142,7 @@
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
- <version>$scala_version_unevaled</version>
+ <version>${scala_version_unevaled}</version>
<scope>test</scope>
</dependency>
</dependencies>
@@ -136,11 +156,15 @@
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.2</version>
<configuration>
+ <checkMultipleScalaVersions>#if($scala_pre_210)true#{else}false#end</checkMultipleScalaVersions>
<charset>$project_build_sourceEncoding_unevaled</charset>
<jvmArgs>
<jvmArg>-Xmx1024m</jvmArg>
<jvmArg>-DpackageLinkDefs=file://$project_build_directory_unevaled/packageLinkDefs.properties</jvmArg>
</jvmArgs>
+ <args>
+ <arg>-deprecation</arg>
+ </args>
</configuration>
<executions>
<execution>
@@ -228,6 +252,39 @@
</classpathContainers>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <id>parse-lift-major-minor-version</id>
+ <goals>
+ <goal>regex-property</goal>
+ </goals>
+ <configuration>
+ <name>lift.majorMinorVersion</name>
+ <value>${lift_version_unevaled}</value>
+ <regex>^([0-9]+)\.([0-9]+).*$</regex>
+ <replacement>$1.$2</replacement>
+ <failIfNoMatch>true</failIfNoMatch>
+ </configuration>
+ </execution>
+ <execution>
+ <id>parse-scala-major-minor-version</id>
+ <goals>
+ <goal>regex-property</goal>
+ </goals>
+ <configuration>
+ <name>scala.majorMinorVersion</name>
+ <value>${scala_version_unevaled}</value>
+ <regex>^([0-9]+)\.([0-9]+).*$</regex>
+ <replacement>$1.$2</replacement>
+ <failIfNoMatch>true</failIfNoMatch>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<reporting>
@@ -10,6 +10,6 @@ object LiftConsole {
// Now run the MainGenericRunner to get your repl
MainGenericRunner.main(args)
// After the repl exits, then exit the scala script
- exit(0)
+ sys.exit(0)
}
}
@@ -9,7 +9,7 @@ import Helpers._
import lib._
import org.specs2.mutable.Specification
import org.specs2.specification.AroundExample
-import org.specs2.execute.Result
+import org.specs2.execute.AsResult
object HelloWorldTestSpecs extends Specification with AroundExample {
@@ -20,10 +20,10 @@ object HelloWorldTestSpecs extends Specification with AroundExample {
* For additional ways of writing tests,
* please see http://www.assembla.com/spaces/liftweb/wiki/Mocking_HTTP_Requests
*/
- def around[T <% Result](body: => T) = {
+ def around[T : AsResult](body: => T) = {
S.initIfUninitted(session) {
DependencyFactory.time.doWith(stableTime) {
- body
+ AsResult(body)
}
}
}
@@ -16,22 +16,19 @@
~ limitations under the License.
-->
-<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/xsd/maven-4.0.0.xsd">
+<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>net.liftweb</groupId>
- <artifactId>archetypes_2.9.1</artifactId>
+ <artifactId>archetypes_2.10</artifactId>
<version>2.5.1-SNAPSHOT</version>
</parent>
- <artifactId>lift-archetype-blank_2.9.1</artifactId>
+ <artifactId>lift-archetype-blank_2.10</artifactId>
<packaging>maven-archetype</packaging>
- <properties>
- <lift.version>${project.parent.version}</lift.version>
- <maven.resources.escapeString>\</maven.resources.escapeString>
- </properties>
-
<!--
~ More Project Information
-->
@@ -3,10 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- #set($scala_version_unevaled = '\${scala.version}')
- #set($project_basedir = '\${project.basedir}')
- #set($project_build_sourceEncoding_unevaled = '\${project.build.sourceEncoding}')
- #set($project_build_directory_unevaled = '\${project.build.directory}')
+#set($scala_pre_210 = $scalaVersion.compareTo("2.10") < 0)
+#set($scala_version_unevaled = '\${scala.version}')
+#set($scala_major_minor_version_unevaled = '\${scala.majorMinorVersion}')
+#set($lift_version_unevaled = '\${lift.version}')
+#set($lift_major_minor_version_unevaled = '\${lift.majorMinorVersion}')
+#set($project_basedir = '\${project.basedir}')
+#set($project_build_sourceEncoding_unevaled = '\${project.build.sourceEncoding}')
+#set($project_build_directory_unevaled = '\${project.build.directory}')
<modelVersion>4.0.0</modelVersion>
<groupId>$groupId</groupId>
@@ -16,7 +20,11 @@
<name>$artifactId Project</name>
<inceptionYear>2010</inceptionYear>
<properties>
+ <lift.version>$liftVersion</lift.version>
+ <!-- <lift.majorMinorVersion> @see regex-property executions </lift.majorMinorVersion> -->
<scala.version>$scalaVersion</scala.version>
+ <!-- <scala.majorMinorVersion> @see regex-property executions </scala.majorMinorVersion> -->
+
<!-- Common plugin settings -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>$project_build_sourceEncoding_unevaled</project.reporting.outputEncoding>
@@ -62,13 +70,21 @@
<dependencies>
<dependency>
<groupId>net.liftweb</groupId>
- <artifactId>lift-mapper_$scalaVersion</artifactId>
+#if ($scala_pre_210)
+ <artifactId>lift-mapper_${scala.version}</artifactId>
+#else
+ <artifactId>lift-mapper_${scala.majorMinorVersion}</artifactId>
+#end
<version>$liftVersion</version>
</dependency>
<dependency>
<groupId>net.liftmodules</groupId>
- <artifactId>lift-jquery-module_$scalaVersion</artifactId>
- <version>${liftVersion}-2.0</version>
+#if ($liftVersion.compareTo("2.5") < 0)
+ <artifactId>lift-jquery-module_${scala.version}</artifactId>
+#else
+ <artifactId>lift-jquery-module_${lift.majorMinorVersion}_${scala.majorMinorVersion}</artifactId>
+#end
+ <version>[2.4,3.0)</version>
</dependency>
#if ($logBackend.equalsIgnoreCase("logback"))
<dependency>
@@ -102,7 +118,11 @@
</dependency>
<dependency>
<groupId>org.specs2</groupId>
+#if ($scala_pre_210)
<artifactId>specs2_${scala.version}</artifactId>
+#else
+ <artifactId>specs2_${scala.majorMinorVersion}</artifactId>
+#end
<version>${specs.version}</version>
<scope>test</scope>
</dependency>
@@ -130,11 +150,15 @@
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.2</version>
<configuration>
+ <checkMultipleScalaVersions>#if($scala_pre_210)true#{else}false#end</checkMultipleScalaVersions>
<charset>$project_build_sourceEncoding_unevaled</charset>
<jvmArgs>
<jvmArg>-Xmx1024m</jvmArg>
<jvmArg>-DpackageLinkDefs=file://$project_build_directory_unevaled/packageLinkDefs.properties</jvmArg>
</jvmArgs>
+ <args>
+ <arg>-deprecation</arg>
+ </args>
</configuration>
<executions>
<execution>
@@ -222,6 +246,39 @@
</classpathContainers>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>build-helper-maven-plugin</artifactId>
+ <version>1.8</version>
+ <executions>
+ <execution>
+ <id>parse-lift-major-minor-version</id>
+ <goals>
+ <goal>regex-property</goal>
+ </goals>
+ <configuration>
+ <name>lift.majorMinorVersion</name>
+ <value>${lift.version}</value>
+ <regex>^([0-9]+)\.([0-9]+).*$</regex>
+ <replacement>$1.$2</replacement>
+ <failIfNoMatch>true</failIfNoMatch>
+ </configuration>
+ </execution>
+ <execution>
+ <id>parse-scala-major-minor-version</id>
+ <goals>
+ <goal>regex-property</goal>
+ </goals>
+ <configuration>
+ <name>scala.majorMinorVersion</name>
+ <value>${scala.version}</value>
+ <regex>^([0-9]+)\.([0-9]+).*$</regex>
+ <replacement>$1.$2</replacement>
+ <failIfNoMatch>true</failIfNoMatch>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
<reporting>
@@ -10,6 +10,6 @@ object LiftConsole {
// Now run the MainGenericRunner to get your repl
MainGenericRunner.main(args)
// After the repl exits, then exit the scala script
- exit(0)
+ sys.exit(0)
}
}
@@ -9,7 +9,7 @@ import Helpers._
import lib._
import org.specs2.mutable.Specification
import org.specs2.specification.AroundExample
-import org.specs2.execute.Result
+import org.specs2.execute.AsResult
object HelloWorldTestSpecs extends Specification with AroundExample {
@@ -20,10 +20,10 @@ object HelloWorldTestSpecs extends Specification with AroundExample {
* For additional ways of writing tests,
* please see http://www.assembla.com/spaces/liftweb/wiki/Mocking_HTTP_Requests
*/
- def around[T <% Result](body: => T) = {
+ def around[T : AsResult](body: => T) = {
S.initIfUninitted(session) {
DependencyFactory.time.doWith(stableTime) {
- body
+ AsResult(body)
}
}
}
Oops, something went wrong.

0 comments on commit ab1e21c

Please sign in to comment.