我有兴趣构建未压缩的 jar 文件,以便在只有少数类更改时使我的 rsync 更快,到目前为止,我不知道如何告诉sbtassembly禁用压缩。
server > inspect assembly
[info] Task: java.io.File
[info] Description:
[info] Builds a single-file deployable jar.
[info] Provided by:
[info] {file:/.../}server/*:assembly
[info] Dependencies:
[info] server/*:assembly-merge-strategy(for assembly)
[info] server/*:assembly-output-path(for assembly)
[info] server/*:package-options(for assembly)
[info] server/*:assembly-assembled-mappings(for assembly)
[info] server/*:cache-directory
[info] server/*:test(for assembly)
[info] server/*:streams(for assembly)
[info] Delegates:
[info] server/*:assembly
[info] {.}/*:assembly
[info] */*:assembly
...
server > inspect assembly-option(for assembly)
[info] Setting: sbtassembly.AssemblyOption = AssemblyOption(true,true,true,<function1>)
[info] Description:
[info]
[info] Provided by:
[info] {file:/.../}server/*:assembly-option(for assembly)
[info] Dependencies:
[info] server/*:assembly-assemble-artifact(for package-bin)
[info] server/*:assembly-assemble-artifact(for assembly-package-scala)
[info] server/*:assembly-assemble-artifact(for assembly-package-dependency)
[info] server/*:assembly-excluded-files(for assembly)
...
然而, AssemblyOption没有说明任何关于打包的内容,并且该插件似乎为此使用了 sbt 自己的Package,所以也许有一种方法可以配置它?包依次调用IO.jar(...)来写入文件。这使用withZipOutput来制作一个 ZipOutputStream (或一个 JarOutputStream),我想在其上调用setMethod(ZipOutputStream.STORED),但我不能。
除了 sbt 功能请求之外还有什么想法吗?