How can sbt-web output be used with xsbt-web-plugin via a SBT project dependency?

后端 未结 1 1735
我寻月下人不归
我寻月下人不归 2021-02-11 00:50

I am trying to use the sbt-web plugin without the play framework and instead build a webapp using the xsbt-web-plugin.

I have gotten the sbt-web plugin working correctly

1条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-11 01:34

    If you tell xsbt-web-plugin to use sbt-web's output as its Web application resources directory, it should get you most of the way.

    Just add webappSrc in webapp <<= WebKeys.assets in Assets as a setting to your example_webapp project:

    lazy val example_webapp =
      project
        .in(file("example_webapp"))
        .dependsOn(example_webjar)
        .settings(libraryDependencies ++= Seq(
          "javax.servlet" % "servlet-api" % "2.5" % "provided",
          "org.eclipse.jetty" % "jetty-webapp" % "9.3.0.M2" % "container",
          "org.eclipse.jetty" % "jetty-plus"   % "9.3.0.M2" % "container",
          "commons-logging" % "commons-logging" % "1.2" % "container"
        ))
        .enablePlugins(SbtWeb)
        .settings(jetty(): _*)
        .settings(webappSrc in webapp <<= WebKeys.assets in Assets)
    

    0 讨论(0)
提交回复
热议问题