2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

前から気になっていたLiftを使って見る話

Posted at

思い立ってやってみました。
まずはインストールですが、コレがわかりにくい。

色々調べてこの記事を見つけました。どうやらGradleを使って最小構成でインストール出来るようです。

 git clone git@github.com:jeppenejsum/liftstart.git

で、このままだと構成が少し古いので、build.gradleのバージョン指定をいじります。

build.gradle
// Minimal build.gradle for Lift project
apply {
    plugin 'scala'
    plugin 'war'
    plugin 'jetty'
    plugin 'eclipse'
}

scalaVersion = '2.9.2'
liftVersion = '2.5-M4'
specs2Version = "1.8.2"

jettyRun.contextPath = "/"

repositories {
    mavenCentral()
    mavenRepo name:'scala-releases', urls:'http://scala-tools.org/repo-releases/'
    mavenRepo name:'scala-snapshots', urls:'http://scala-tools.org/repo-snapshots/'
}
configurations {
    scalaCompiler
    scalaLibrary
}

eclipse {
  classpath.containers += ["org.scala-ide.sdt.launching.SCALA_CONTAINER"]
  classpath.minusConfigurations = [configurations.scalaLibrary]
  classpath.plusConfigurations =  ([configurations.scalaCompiler]  + classpath.plusConfigurations)
}

dependencies {
    scalaTools "org.scala-lang:scala-compiler:$scalaVersion", 
        "org.scala-lang:scala-library:$scalaVersion"    

    scalaCompiler "org.scala-lang:scala-compiler:$scalaVersion"
    scalaLibrary "org.scala-lang:scala-library:$scalaVersion"

    compile "org.scala-lang:scala-library:$scalaVersion", 
    	"net.liftweb:lift-mapper_$scalaVersion:$liftVersion", 
    	"net.liftweb:lift-webkit_$scalaVersion:$liftVersion",
    	"net.liftweb:lift-util_$scalaVersion:$liftVersion",
    	"net.liftweb:lift-actor_$scalaVersion:$liftVersion",
    	"net.liftweb:lift-common_$scalaVersion:$liftVersion",
    	"net.liftweb:lift-json_$scalaVersion:$liftVersion", 
        "ch.qos.logback:logback-classic:0.9.29",
        "ch.qos.logback:logback-core:0.9.29",
        "com.h2database:h2:1.+"

    testCompile "junit:junit:4.5", 
        "org.specs2:specs2_$scalaVersion:$specs2Version",
        "org.scala-lang:scala-compiler:$scalaVersion",
	'org.mortbay.jetty:jetty:9.+',
	'org.mortbay.jetty:jetty-util:9.+',
	'org.mortbay.jetty:jetty-management:9.+'
	"org.scala-lang:scala-compiler:$scalaVersion"  // Needed for LiftConsole	

    providedCompile 'javax.servlet:servlet-api:3.+' 
}

task wrapper(type: Wrapper) {
    gradleVersion = '1.3'
}

なるべく最新の状態になるようにしています。
この構成で問題が出来るかどうかはまだわかりませんが、なんとなく新しいほうが素敵です。

でこの設定ができたら、インストールディレクトリで

./gradlew jettyRun

を実行します。

すると、localhost:8080にアクセスすると、以下の画面が表示されます。
Lift

いやぁ、なんか色々苦労した。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?