5

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?

Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319
James Black
  • 41,583
  • 10
  • 86
  • 166
  • Potential duplicate of [How to create executable single jar which include webapp resources by sbt-assembly with scalatra](http://stackoverflow.com/questions/8374174/) – Eugene Yokota Oct 22 '13 at 02:03

1 Answers1

12

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" }
Community
  • 1
  • 1
Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319
  • Thank you. I was assuming it was an sbtassembly problem. Tomorrow I will test if it was an sbt issue. – James Black Oct 22 '13 at 01:36
  • 1
    You put me on the correct path, I ended up succeeding with: resourceDirectory in Compile <<= baseDirectory(_ / "src/main/webapp") – James Black Oct 22 '13 at 12:33