title: sbt web plugin: Not a valid key: jetty-run (similar: jetty-port, jetty-context, run)
body: <p>I'm trying to set up a scala sbt project with the lift web framework. I'm using</p>
  
  <ul>
  <li>scala 2.9.0-1</li>
  <li>sbt 0.10.1</li>
  <li>lift 2.3</li>
  <li>xsbt-web-plugin 0.1.1 (which is only on scala 2.8.1, see end of question)</li>
  </ul>
  
  <p>(quite recent versions I know).
  I followed <a href="http://d.hatena.ne.jp/k4200/20110711/1310354698" rel="noreferrer">http://d.hatena.ne.jp/k4200/20110711/1310354698</a> and <a href="https://github.com/siasia/xsbt-web-plugin/blob/master/README.md" rel="noreferrer">https://github.com/siasia/xsbt-web-plugin/blob/master/README.md</a> to obtain the following sbt configuration files:</p>
  
  <p>project/build.properties</p>
  
  <p><code>sbt.version=0.10.1</code></p>
  
  <p>project/plugins/build.sbt</p>
  
  <pre><code>resolvers += "Web plugin repo" at "http://siasia.github.com/maven2"
  
  libraryDependencies &lt;+= sbtVersion(v =&gt; "com.github.siasia" % "xsbt-web-plugin_2.8.1" % ("0.1.1-"+v))
  </code></pre>
  
  <p>project/Build.scala</p>
  
  <pre><code>import sbt._
  import Keys._
  
  object BuildSettings {
    val buildOrganization = "xbaz"
    val buildScalaVersion = "2.9.0-1"
    val buildVersion      = "0.0.1"
  
    val buildSettings = Defaults.defaultSettings ++ Seq (
      organization := buildOrganization,
      scalaVersion := buildScalaVersion,
      version      := buildVersion)
  }
  
  object Resolvers {
    val webPluginRepo = "Web plugin repo" at "http://siasia.github.com/maven2"
    val jettyRepo = "Jetty Repo" at "http://repo1.maven.org/maven2/org/mortbay/jetty"
  }
  
  object Dependencies {
  
   // web plugin
    val webPluginDeps = Seq(
      "org.mortbay.jetty" % "jetty" % "6.1.26" % "jetty", // The last part is "jetty" not "test".
      "javax.servlet" % "servlet-api" % "2.5" % "provided-&gt;default"
    )
  
    val liftDeps = {
      val liftVersion = "2.3" // I'll switch to 2.3 soon!
      Seq(
        "net.liftweb" % "lift-webkit_2.8.1" % liftVersion % "compile-&gt;default",
        "net.liftweb" % "lift-mapper_2.8.1" % liftVersion % "compile-&gt;default"
      )
    }
  
    val scalaTest = "org.scalatest" % "scalatest_2.9.0" % "1.6.1" % "test"
    val apacheHttpClient = "org.apache.httpcomponents" % "httpclient" % "4.1.1"
    val apacheHttpCore = "org.apache.httpcomponents" % "httpcore" % "4.1.1"
  
    // Logging
    lazy val grizzled = "org.clapper" % "grizzled-slf4j_2.8.1" % "0.5"
    lazy val junit = "junit" % "junit" % "4.8" % "test"
    lazy val logback_core = "ch.qos.logback" % "logback-core" % "0.9.24" % "compile" //LGPL 2.1
    lazy val logback_classic = "ch.qos.logback" % "logback-classic" % "0.9.24" % "compile" //LGPL 2.1
    lazy val log4j_over_slf4j = "org.slf4j" % "log4j-over-slf4j" % "1.6.1"
  
  
    val logDeps = Seq(grizzled, log4j_over_slf4j, logback_core, logback_classic)
  }
  
  
  object MyBuild extends Build {
    import com.github.siasia.WebPlugin._ // web plugin
    import BuildSettings._
    import Dependencies._
    import Resolvers._
  
    //End dependencies
  
    lazy val root = Project("root", file(".") , settings = buildSettings ++
      Seq( name := "foo")
    ) aggregate(core, cli, web)
      //  mainClass:= Some("Main"))
  
    lazy val core : Project = Project("core", file("core"), delegates = root :: Nil, settings = buildSettings ++
      Seq(
      name := "foo-core",
      libraryDependencies ++= logDeps ++ Seq(scalaTest, apacheHttpClient, apacheHttpCore)
      )
    )
  
    lazy val cli: Project = Project("cli", file("cli"), settings = buildSettings ++ 
      Seq(
      name := "foo-cli",
      libraryDependencies ++= logDeps ++ Seq(apacheHttpClient),
      fork in run := true,
      javaOptions in run += "-Djava.library.path=/home/jolivier/Projets/asknow/lib/jnotify-lib-0.93"
    )) dependsOn(core) settings(
    )
  
    lazy val web: Project = Project("web", file("web"), settings = buildSettings ++
      Seq (resolvers := Seq(webPluginRepo, jettyRepo),
      name := "foo-http",
      libraryDependencies ++= logDeps ++ webPluginDeps ++ liftDeps
      ) ++ 
      webSettings
    ) dependsOn(core)
  }
  </code></pre>
  
  <p>When I try sbt jetty-run I get the following error message:</p>
  
  <pre><code>[error] Not a valid command: jetty-run
  [error] Not a valid project ID: jetty-run
  [error] Not a valid configuration: jetty-run
  [error] Not a valid key: jetty-run (similar: jetty-port, jetty-context, run)
  [error] jetty-run
  [error]
  </code></pre>
  
  <p>So I noticed that some jetty-* commands do exist, but not the one I want, so I printed webSettings which is supposed to contain all these new settings and it contains jetty-context and jetty-port, as well as jetty-configuration and others, but not jetty-run :s.</p>
  
  <p>What did I go wrong to not have jetty-run?</p>
  
  <p>I tried switching to scala-2.8.1 since the web plugin is currently only on scala 2.8.1, by changing my buildScalaVersion variable but that didn't change anything.  Do you have any idea?</p>
  
  <p>Thanks in advance for your help</p>