我使用https://github.com/sbt/sbt-assembly的sbtassembly和这个合并策略:
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)
}
}
由于某些原因,我的静态内容未包含在可执行jar中,但我的webservices工作正常(因此它确实有效)。
如何添加index.html和javascript文件?
答案 0 :(得分:11)
有一个相关问题Why sbt compile doesn't copy unmanaged resources to classpath?,您可以了解该设置。
这是使用sbt 0.13的设置:
unmanagedResourceDirectories in Compile += { baseDirectory.value / "src/main/webapp" }