ScalaのWebフレームワークLift。
インストールするにはこちらのサイトが大変参考になります。
scalaのWebフレームワーク liftで遊ぶ(2) - インストール - ゆろよろ日記
まずScalaはインストールしておいてね。
Mavenのバージョン。
$ mvn -version Maven version: 2.0.9 Java version: 1.5.0_16 OS name: "mac os x" version: "10.5.5" arch: "i386" Family: "unix"
プロジェクトの作成。groupIdは任意で。artifactIdもお好きなものを。
$ mvn archetype:create -U -DarchetypeGroupId=net.liftweb -DarchetypeArtifactId=lift-archetype-basic -DarchetypeVersion=0.9 -DremoteRepositories=http://scala-tools.org/repo-releases -DgroupId=net.kronosjp.sakata -DartifactId=hello-lift [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 minute 38 seconds [INFO] Finished at: Wed Oct 15 16:41:04 JST 2008 [INFO] Final Memory: 8M/15M [INFO] ------------------------------------------------------------------------
カレントディレクトリにartifactIdの値(サンプルではhello-lift)のディレクトリができているので、移る。
で、サーブレットコンテナjettyを起動。
$ cd hello-lift/ $ mvn jetty:run -U [INFO] Started Jetty Server [INFO] Starting scanner at interval of 5 seconds.
ブラウザでlocalhost:8080を見ると、画面が表示される。
プロジェクトをeclipseのプロジェクトにしておく。
$ mvn eclipse:eclipse [INFO] Sources for some artifacts are not available. List of artifacts without a source archive: o log4j:log4j:1.2.12 o commons-logging:commons-logging:1.0.3 o com.rabbitmq:rabbitmq-client:1.2.0 o org.igniterealtime.smack:smack:3.0.4 o org.igniterealtime.smack:smackx:3.0.4 o org.apache.derby:derby:10.2.2.0 Javadoc for some artifacts is not available. Please run the same goal with the -DdownloadJavadocs=true parameter in order to check remote repositories for javadoc. List of artifacts without a javadoc archive: o javax.servlet:servlet-api:2.5 o junit:junit:3.8.1 o net.liftweb:lift-core:0.9 o net.liftweb:lift-webkit:0.9 o log4j:log4j:1.2.12 o javax.mail:mail:1.4 o javax.activation:activation:1.1 o commons-httpclient:commons-httpclient:3.0.1 o commons-logging:commons-logging:1.0.3 o commons-codec:commons-codec:1.3 o commons-fileupload:commons-fileupload:1.2 o commons-collections:commons-collections:3.2 o net.liftweb:lift-textile:0.9 o net.liftweb:lift-facebook:0.9 o net.liftweb:lift-amqp:0.9 o com.rabbitmq:rabbitmq-client:1.2.0 o org.apache.commons:commons-io:1.3.2 o net.liftweb:lift-xmpp:0.9 o org.igniterealtime.smack:smack:3.0.4 o org.igniterealtime.smack:smackx:3.0.4 o net.liftweb:lift-widgets:0.9 o org.apache.derby:derby:10.2.2.0 o org.mortbay.jetty:jetty:6.1.11 o org.mortbay.jetty:jetty-util:6.1.11 o org.mortbay.jetty:servlet-api-2.5:6.1.11 o org.scala-lang:scala-compiler:2.7.1 [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 minute 19 seconds [INFO] Finished at: Wed Oct 15 16:55:38 JST 2008 [INFO] Final Memory: 8M/16M [INFO] ------------------------------------------------------------------------
eclipseのM2REPOを設定。
$ mvn -Declipse.workspace=/Users/jyukutyo/Documents/workspace eclipse:add-maven-repo [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'eclipse'. [INFO] ------------------------------------------------------------------------ [INFO] Building hello-lift [INFO] task-segment: [eclipse:add-maven-repo] (aggregator-style) [INFO] ------------------------------------------------------------------------ [INFO] [eclipse:add-maven-repo] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2 seconds [INFO] Finished at: Wed Oct 15 17:04:54 JST 2008 [INFO] Final Memory: 5M/9M [INFO] ------------------------------------------------------------------------
Scalaのeclipseプラグインも入れておこう。アップデートサイトから。
http://www.scala-lang.org/downloads/scala-plugin/