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

99封情书 提交于 2019-12-19 07:52:28

问题


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?


回答1:


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" }


来源:https://stackoverflow.com/questions/19502894/sbt-assembly-how-do-i-include-the-static-files-in-src-main-webapp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!