How do I set the class header with dependencies?

I am using the latest sbt 0.13.7 and I would like to set the header of Class-Path

my file MANIFEST.MF

with all project dependencies and I really don’t know how. I have read Customize Packaging .

I know how to set other headers, for example Main-Class

:

mainClass in (Compile, packageBin) := Some("mypackage.MyClass")

      

I know it can be done with the sbt-assembly plugin, but I don't want to create one big jar, just a small jar that includes all the dependencies.

I found that I could install Class-Path

using *.jar

as shown in this snippet:

packageOptions in (Compile, packageBin) +=
  Package.ManifestAttributes(java.util.jar.Attributes.Name.CLASS_PATH -> "*.jar")

      

It looks like this workaround is not the final solution. Any guidance is greatly appreciated.

+3


source to share





All Articles