如何使用SBT程序集通过选定的scala类打包jar。使用SBT完整项目时创建为jar。有没有办法排除类?请帮忙 。
答案 0 :(得分:1)
您可以assemblyMergeStrategy
与MergeStrategy.discard
一起使用以放弃您想要的课程,例如:
assemblyMergeStrategy in assembly := {
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 =>
val oldStrategy = (assemblyMergeStrategy in assembly).value
oldStrategy(x)
}
参考: