在 sbt pack 输出 jar 中包含 scala 源文件

Include scala source files in sbt pack output jar

项目的scala源文件如何包含在sbt pack生成的目标jar中?

目前,当我的 jar 的 IDE 用户试图跳转到库中的函数时,他们只会得到代码的反编译版本,而不是原始源代码。但是,从工件存储库中提取的其他库具有跳转到原始源代码的能力。

提前感谢您的考虑和回复。

我认为你可以使用:

packageSrc: Creates a jar file containing all main source files and resources. The packaged paths are relative to src/main/scala and src/main/resources. Similarly, test:packageSrc operates on test source files and resources.

sbt Command Line Reference