Georg Heiler Georg Heiler - 1 year ago 99
Java Question

sbt assembly switch between provided dependencies

I am developing a spark application. To test it locally I want to run

run. This requires the dependencies to be available locally. But I also want to use
sbt assembly
to generate a jar which can be used for
that jar should only include some of the dependencies e.g. not include the spark dependencies.

When I mark a dependency in
% "provided"
it no longer is available via
sbt run

Answer Source

If the case to exclude jars in assembly use in main built.sbt

excludedJars in assembly := {
  val cp = (fullClasspath in assembly).value
  cp filter {f =>"spark"),"jar_name")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download