Georg Heiler Georg Heiler - 6 months ago 40
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


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")