Scala2.8 + Lift2.2 + SBT0.7.4 で構築

これを見ながらやってみた。
http://www.assembla.com/wiki/show/liftweb/USING_sbt

事前準備

  • JDKをインストール
  • Scalaをインストール
  • Mavenをインストール
  • SBTをインストール

まずはMavenで基本構造を作成

適当なディレクトリ作成

$mkdir work
$cd work

Mavenアーキタイプを指定してLiftをダウンロード。赤字部分は任意の文字列を入力。

$mvn archetype:generate -U \
> -DarchetypeGroupId=net.liftweb \
> -DarchetypeArtifactId=lift-archetype-basic_2.8.0 \
> -DarchetypeVersion=2.2-SNAPSHOT \
> -DarchetypeRepository=http://scala-tools.org/repo-snapshots \
> -DremoteRepositories=http://scala-tools.org/repo-snapshots \
> -DgroupId=your.domain \
    
とすると、以下が出力されて構築完了。
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from central
[INFO] org.codehaus.mojo: checking for updates from central
[INFO] artifact org.apache.maven.plugins:maven-archetype-plugin: checking for updates from central
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] [archetype:generate {execution: default-cli}]
[INFO] Generating project in Interactive mode
[INFO] Archetype defined by properties
[INFO] snapshot net.liftweb:lift-archetype-basic_2.8.0:2.2-SNAPSHOT: checking for updates from lift-archetype-basic_2.8.0-repo
Downloading: http://scala-tools.org/repo-snapshots/net/liftweb/lift-archetype-basic_2.8.0/2.2-SNAPSHOT/lift-archetype-basic_2.8.0-2.2-SNAPSHOT.jar
15K downloaded  (lift-archetype-basic_2.8.0-2.2-SNAPSHOT.jar)
Downloading: http://scala-tools.org/repo-snapshots/net/liftweb/lift-archetype-basic_2.8.0/2.2-SNAPSHOT/lift-archetype-basic_2.8.0-2.2-SNAPSHOT.pom
2K downloaded  (lift-archetype-basic_2.8.0-2.2-SNAPSHOT.pom)
[INFO] Using property: groupId = your.domain
[INFO] Using property: artifactId = sample
Define value for property 'version': 1.0-SNAPSHOT: 
[INFO] Using property: package = your.domain
[INFO] Using property: liftVersion = 2.2-SNAPSHOT
[INFO] Using property: logBackend = logback
[INFO] Using property: scalaVersion = 2.8.0
Confirm properties configuration:
groupId: your.domain
artifactId: sample
version: 1.0-SNAPSHOT
package: your.domain
liftVersion: 2.2-SNAPSHOT
logBackend: logback
scalaVersion: 2.8.0
Y: y
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 21 seconds
[INFO] Finished at: Thu Dec 02 02:39:48 JST 2010
[INFO] Final Memory: 11M/20M
[INFO] ------------------------------------------------------------------------

SBTでプロジェクトを初期化する

作成されたディレクトリへ移動。
$cd sample
SBT実行。
$sbt
すると全自動で完了する。
Getting Scala 2.7.7 ...
retrieving :: org.scala-tools.sbt#boot-scala
confs: [default] 2 artifacts copied, 0 already retrieved (9911kB/422ms) Getting org.scala-tools.sbt sbt_2.7.7 0.7.4 ...
retrieving :: org.scala-tools.sbt#boot-app
confs: [default] 15 artifacts copied, 0 already retrieved (4096kB/322ms) [info] Recompiling project definition... [info] Source analysis: 1 new/modified, 0 indirectly invalidated, 0 removed. Getting Scala 2.8.0 ...
retrieving :: org.scala-tools.sbt#boot-scala
confs: [default] 2 artifacts copied, 0 already retrieved (14484kB/646ms) [info] Building project sample 1.0-SNAPSHOT against Scala 2.8.0 [info] using LiftProject with sbt 0.7.4 and Scala 2.7.7 >
%%% 書きかけ %%%