包装罐使用SBT组件

时间:2017-03-27 08:01:11

标签: scala intellij-idea sbt-assembly

如何使用SBT程序集通过选定的scala类打包jar。使用SBT完整项目时创建为jar。有没有办法排除类?请帮忙 。

1 个答案:

答案 0 :(得分:1)

您可以assemblyMergeStrategyMergeStrategy.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)
}

参考:

https://github.com/sbt/sbt-assembly#merge-strategy