2011-10-07 5 views
6

私はsbtでscala webプロジェクトを設定しようとしています。私は設定に従っている。SBT Web Plugin:ScopedKeyの取得中にエラーが発生しました(Scope(This、Select(ConfigKey(container))、This、This)、フルクラスパス)

  • スカラ2.9.0-1
  • のsbt 0.11.0
  • xsbt-ウェブプラグイン0.2.1

プロジェクト/ plugins.sbt

libraryDependencies <+= sbtVersion(v => "com.github.siasia" %% "xsbt-web-plugin" % (v+"-0.2.1")) 

プロジェクト/ TaskTrackerBuild.scala

import sbt._ 
import com.github.siasia._ 
import WebPlugin._ 
import PluginKeys._ 
import Keys._ 
/** 
* Main sbt build file for the task-tracker project. 
    * 
*/ 
object TicketingCoreProject extends Build { 
    val ticketingVersion = "1.0.0-SNAPSHOT" 
    val Organization = "org.sansoft" 
    val ScalaVersion = "2.9.0-1" 

    val jodaTime = "joda-time" % "joda-time" % "1.6" 
    val scalaTime = "org.scala-tools.time" % "time_2.8.0" % "0.2" 
    val casbah = "com.mongodb.casbah" % "casbah_2.9.0-1" % "2.1.5.0" 
    val Slf4jLog4jDep = "org.slf4j" % "slf4j-log4j12" % "1.6.1" 
    val ScalaCheckDep = "org.scala-tools.testing" %% "scalacheck" % "1.9" % "test" 
    val JUnitDep = "junit" % "junit" % "4.8.2" % "test" 
    val scalaTesting = "org.scala-tools.testing" %% "specs" % "1.6.8" % "test" 
    //val scctSbt = "ch.craven" %% "scct-plugin" % "0.2" 
    val vaadin = "com.vaadin" % "vaadin" % "6.7.0" 

    val jettyWebApp = "org.eclipse.jetty" % "jetty-webapp" % "7.3.0.v20110203" % "container" 
    val jettyPlus = "org.eclipse.jetty" % "jetty-plus" % "7.3.0.v20110203" % "container" 

    val repositories = Seq(
    ScalaToolsSnapshots, 
    "typesafe releases" at "http://repo.typesafe.com/typesafe/releases", 
    "typesafe snapshots" at "http://repo.typesafe.com/typesafe/snapshots", 
    "scct-repo" at "http://mtkopone.github.com/scct/maven-repo") 

    def publishToRepository = Some(Resolver.file("Local Maven Repository", Path.userHome/".m2"/"repository" asFile)) 

    lazy val baseSettings = Defaults.defaultSettings ++ Seq(
    version := ticketingVersion, 
    organization := Organization, 
    scalaVersion := ScalaVersion, 
    publishMavenStyle := true, 
    publishTo := publishToRepository, 
    resolvers ++= repositories, 
    checksums := Nil 
) 

    lazy val parent = Project("taskTrackerParent", file("."), 
    settings = baseSettings ++ Seq(
     name := "task-tracker-parent" 
    )) 

    lazy val core = Project("core", file("core"), 
    settings = baseSettings ++ Seq(
     name := "core", 
     libraryDependencies ++= Seq(
     jodaTime, 
     scalaTime, 
     scalaTesting, 
     ScalaCheckDep, 
     casbah, 
     jodaTime, 
    scalaTime))) 

    lazy val web = Project("web", file("web"), 
    settings = baseSettings ++ webSettings ++ Seq(
     name := "web", 
     libraryDependencies ++= Seq(
     jodaTime, 
     scalaTime, 
     scalaTesting, 
     ScalaCheckDep, 
     casbah, 
    jodaTime, 
    scalaTime, 
     vaadin, 
     jettyWebApp, 
     jettyPlus))) dependsOn(core) 

} 

このビルドファイルでsbtを起動しようとすると、次のエラーが発生します。

[error] Error getting ScopedKey(Scope(This,Select(ConfigKey(container)),This,This),full-classpath) 
[error] Use 'last' for the full log. 

Webプロジェクトから設定webSettingsを削除すると、sbtプロジェクトが正常にコンパイルされます。 私はこれで間違って何をしましたか?

ありがとうございます。

+0

'xsbt-web-plugin'依存関係をフルビルド構成(' project/TaskTrackerBuild.scala')に移すことを考えましたか?私は疑いがあります、短いと完全な設定を共存させることは良い(安全ではない)方法です。 –

+1

実際にはxsbt-web-plugin [https://github.com/siasia/xsbt-web-plugin/issues/40](https://github.com/siasia/xsbt-web-plugin)にバグがありました/ issues/40)。今は固定されており、私のビルドビルドは正常に動作しています。 –

答えて

1

webSettingsを使用しようとしたときとまったく同じ問題が発生しました。

今日、私はプロジェクトのドキュメントに解決策を見つけた: https://github.com/siasia/xsbt-web-plugin/wiki/Deployment-scenarios

私はwebSettingsからwebAppSettingsに変更したときにプラグインが動作します。

+0

webappSettings * –

関連する問題