2
votes

I'm using SBT as a build tool for spark projects. I'm able to create a fat jar of my dependencies using the sbt-assembly plugin.

However, this produces a ~120M jar, mostly of dependencies which I need to keep uploading to S3 to run my code -- this takes 3-5 minutes to do. Not a lot of time, but fairly annoying.

What would improve things a lot would be to have SBT produce a jar of the dependencies (which changes rarely), and a small jar of my application code which I should be able to upload in a few seconds.

Is this possible? I'm pretty new to SBT.

1

1 Answers

3
votes

sbt-assembly supports out-of-the-box splitting project application jar from dependency jar. To produce just the dependency jar execute

sbt assemblyPackageDependency

To produce jar with just your project application code define assemblyOption as follows

assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false, includeDependency = false)

and execute sbt assembly as usual.