Deduplication error in build.sbt when building a fat jar using sbt assembly

泪湿孤枕 提交于 2019-12-09 05:11:27

The problem is sbt-assembly cannot choose which META-INF/ECLIPSEF.RSA file to pickup. Try this to exclude all such files:

excludedFiles in assembly <<=
(excludedFiles in assembly) {
  (old) => (bases) =>
    old(bases) ++ (bases flatMap (base =>
      (base / "META-INF/ECLIPSEF.RSA").get))
}

If you really need some RSA key inside jar:

assembledMappings in assembly <<= (assembledMappings in assembly) map { (old: File => Seq[(File, String)]) =>
  (f: File) => old(f) :+ (file("path/to/choosen/rsa/key"), "META-INF/ECLIPSEF.RSA")
}

(or don't mention it in excludedFiles for appropriate base)

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