Sbt-assembly: How to include static files in src / main / webapp

I am using sbtassembly from https://github.com/sbt/sbt-assembly using this merge strategy:

mergeStrategy in assembly <<= (mergeStrategy in assembly) { (old) =>
  {
    case PathList("javax", "servlet", xs @ _*)         => MergeStrategy.first
    case PathList(ps @ _*) if ps.last endsWith ".html" => MergeStrategy.first
    case "application.conf" => MergeStrategy.concat
    case "unwanted.txt"     => MergeStrategy.discard
    case x => old(x)
  }
}

For some reason, my static content is not included in the executable jar, but my web services are working fine (so it works).

How can I include index.html and javascript files?

+4
source share
1 answer

There is a related question. Why does sbt compilation not copy unmanaged resources to the classpath? that you can get an idea of ​​this setting.

Here's the setup using sbt 0.13:

unmanagedResourceDirectories in Compile += { baseDirectory.value / "src/main/webapp" }
+8
source

All Articles