Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sbt-assembly: How do I include the static files in src/main/webapp

I am using sbtassembly from https://github.com/sbt/sbt-assembly with 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 being included in the executable jar, but my webservices work fine (so it does work).

How can I include my index.html and javascript files?

like image 718
James Black Avatar asked Oct 21 '13 19:10

James Black


1 Answers

There's a related question Why sbt compile doesn't copy unmanaged resources to classpath? that you can get an idea for the setting.

Here's the setting using sbt 0.13:

unmanagedResourceDirectories in Compile += { baseDirectory.value / "src/main/webapp" }
like image 89
Eugene Yokota Avatar answered Sep 22 '22 13:09

Eugene Yokota