skinny-framework / sbt-servlet-plugin

:wrench: an sbt plugin to build and run Servlet apps

GitHub

sbt-servlet-plugin

This is a sbt plugin which is based on xsbt-web-plugin 0.9.1. The reason why we forked the sbt plugin is that the version allowed us to reload Scalate templates without restarting a Servlet container every time a user changes them a bit.

Build Status

Getting started

project/plugins.sbt

Add this sbt plugin to your project/plugins.sbt.

addSbtPlugin("org.skinny-framework" % "sbt-servlet-plugin" % "3.0.5")

build.sbt

Add Jetty dependencies into "container" scope.

import skinny.servlet._, ServletPlugin._, ServletKeys._

lazy val jettyVersion = "9.4.12.v20180830"

lazy val root = (project in file("."))
  .settings(ServletPlugin.projectSettings)
  .settings(
    libraryDependencies ++= Seq(
      "org.eclipse.jetty" % "jetty-webapp"      % jettyVersion % "container",
      "org.eclipse.jetty" % "jetty-plus"        % jettyVersion % "container",
      "javax.servlet"     % "javax.servlet-api" % "3.1.0"      % "provided"
    )
  )
  .enablePlugins(ServletPlugin)

License

the BSD 3-Clause license