Search code examples
scalasbtsbt-assemblysbt-plugin

Include scala source files in sbt pack output jar


How can the scala source files of a project be included in the generated target jar produced by sbt pack?

Currently, when an IDE user of my jar tries to jump to a function in the library they will only get decompiled version of the code instead of the original source. However, other libraries pull from artifact repositories have the ability to jump to the original source code.

Thank you in advance for your consideration and response.


Solution

  • I think you can use:

    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