SBT Web Plugin: error getting ScopedKey (Scope (This, Select (ConfigKey (container)), This, This), full-classpath)

I am trying to set up a scala web project using sbt. I have the following settings.

  • scala 2.9.0-1
  • sbt 0.11.0
  • xsbt-web-plugin 0.2.1

Project / plugins.sbt

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

Project / 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) } 

When I try to run sbt with this build file, I get the following error.

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

If I remove the webSettings configuration from the web project project, the sbt project compiles fine. What have I done wrong in this?

Thanks in advance.

+6
source share
1 answer

I had exactly the same problem when I tried to use webSettings.

Today I found a solution for project-doc: https://github.com/siasia/xsbt-web-plugin/wiki/Deployment-scenarios

The plugin works when I switch from webSettings to webAppSettings.

+1
source

Source: https://habr.com/ru/post/898807/


All Articles